Skip navigation

Category Archives: Locking planes

Thought this was going to be an unproductive lunch but I managed to find an easy way to lock the Z position and stop the cube from rotating about. You can also lock the rotation in each axis which solves the problem of the cube falling over:

Setting Constraints

I also found an amended version of the  example of the Unity 2DGameplayTutorialProject Lerpz project here:

This strips out all the fluff and is just the useful movement bits. I’m going to try and learn from this to help me add jumping to my game, as if you just lift an entire script you never understand fully how it works, which will come back to bite you later on when you come to add more features or need to fix bugs with it.

Another useful thing from this example is that it showed me what type of shader I need to add to utilise the transparency on my character PNG:

Transparency Shader

It also uses a plane instead of a cube for the character, which probably makes sense for me so I’ll switch this out later.

Got collision working. Just need to improve the movement so it’s locked to the x and y planes and so you can jump. Currently your cube can easily topple over and then your steering will veer you off in crazy directions.

Ship it!


In unrelated news, I’ve been listening to lots of this: while I work. It’s a great feel good song and also has a brilliant video!