Matrices are an extremely powerful tool when working with vectors. They’re the magic that makes a lot of the code in our shaders work, but they also work in a lot of handy other places.
Unity provides a funtion that allows your MonoBehaviors to be alerted when values are changed on it in the inspector.
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# 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# 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# 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.
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.
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.
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.
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.
One issue that is often encountered when building first person games is that the really close objects like weapons or hands will clip through nearby walls.