Lets explore this new health tracking component we’ve built by introducing the Unity Test Runner to our project. The Unity Test Runner allows you to add a variety of NUnit tests to your project that allow you to create Edit and Play mode tests.
Lets make a component that can track a GameObject’s health in Unity and alert other subscribed objects when the health is changed.
Lets make a top down controller that plays a bit more nicely with the mouse. This will allow us to direct our ship by having it move towards the mouse instead of requiring the controller or keyboard input we have required up to this point.
We have a spaceship that can fly around, but we have a problem. It can fly through things. Lets fix that by changing our current transformation modification into physical forces on a rigidbody!
C# allows you to seed data into your dictionary when it’s constructed by using an initializer function that accepts a series of key, value pairs after its constructor that causes those elements to be automatically inserted into your Dictionary’s for you.
C# includes a method for initializing Lists that means you do not need to repeatedly Add("foo") throughout your code.
C# is a statically typed language meaning you must specify what type your variables are when declaring them. These types are verified by the compiler as you build your project.
C# has the ability to build strings in a number of ways. The simplest is concatenating them, but it’s not always the easiest or best solution depending on what you’re making.
Unity has made it a bit easier to compute some values in their editor windows by allowing you to enter math formula’s into the inspector.
One of the greatest tools for development is a really quick turn around between the code you write and seeing the result of that code.
Gizmos are a really handy way to indicate a whole range of interesting information during development of your project.
Now that we have a spaceship controller that can take a direction input and turn that into movement we can start to play around with it.
How can we turn input on a single joystick into dynamic movement of a spaceship? Let’s explore two new ways we might be able to do that.
Dot Products are a really easy and fun way to compare Vectors in space. When comparing two normalized with a dot product the result will be the cosine of the angle between the two Vectors.
A Shadertoy shader creating a grid. This makes it possible to create an infintely scalable grid pattern that is fairly light-weight.
Time to finally catch our Shader Graph Ripple Shader up to the existing Ripple we created in a Surface Shader a while ago.
Lets take a look at how you might build a solution that allows you to fire projectiles through walls of varying sizes.
With the introduction of Shader Graph Unity also added support for Custom Nodes you can build yourself by creating custom CodeFunctionNode.
A demonstration of early flight mechanics in Asteroids VR that enable complex movement and 6 degrees of freedom.