Spring-based Animation and Quaternions
Spring animation is a modern technique for animating stuff going between two points. Why not apply them to game object transforms?
Interesting things sometimes found here.
Spring animation is a modern technique for animating stuff going between two points. Why not apply them to game object transforms?
I’ve always had trouble remembering which order I should apply matrix multiplications in code, or which side the vector should go on for a matrix transform. Obviously the order is important; you’ll get very strange results if you get it wrong, but the devious thing about matrix math is that you’ll often also get bizarre results if your math is just wrong in some other way. It definitely pays to…
A recording of a recording.
For the past month and a bit I’ve been working on a (2D) game which uses a rope as a core mechanic. I expected this to be challenging, but was (unsurprisingly) caught by a bunch of things and learnt some valuable lessons along the way, which I’m hoping to document here. Let’s first acknowledge that rope is used pretty sparingly in video games, with good reason: It’s computationally expensive to…
Instantiate() is expensive. If possible, you should never use it at runtime. For one-offs this is usually done by spawning whatever objects you need in Awake(), and then calling SetActive(true) when you need them. For more than one-offs, you probably want to use a pool. A pool is a group of objects that you instantiate at some convenient time (probably on scene load), and then later on, when you…
GPU instancing is a graphics technique available in Unity to draw lots of the same mesh and material quickly. In the right circumstances, GPU instancing can allow you to feasibly draw even millions of meshes. Unity tries to make this work automatically for you if it can. If all your meshes use the same material, ‘GPU Instancing’ is ticked, your shader supports instancing, lighting and shadows play…
If you want to do any kind of texture manipulation in games, you’ll need some form of texture coordinates. If you’re in 3D, you can obtain UV coordinates of a particular point on a mesh via raycasting, but there’s no easy way to achieve the same thing for sprite renders.
So you want to make some mods for Duck Game? Look no further. This guide should tell you almost everything you need to know about making a good mod that actually functions. We’ll talk about getting set up, explain some of Duck Game’s core mod structure, talk about networking, and hopefully most of the other little details you might need.
Assigning object references through the Unity inspector is a great tool. Unfortunately though, it tends to really get in the way of doing code-based object instantiation; in particular, there’s no clean Unity-endorsed solution to making simple static classes which utilize game objects.
Something that might surprise you is that there is actually a lack of content on making easy to use inventory systems in Unity.