Implementing Camera movement and bird auto move. 2D Sidescroller

To be able to have a game that runs like Flappy bird. I needed to have the bird move automatically, and the camera follow it. Once making the bird move automatically, I tried to make the normal camera that unity provides follow the player, and it was rather choppy and buggy, so after looking up online how i could fix this bug, I came across a unity add on called cine machine, that helps to make your camera quality better whilst building a game.




First I declared what the movement speed and the Vector 3 were.


I then went on to declare that i would be using the gameMANG script.
Grabbing all objects with the gameController tag on them.
I then Transformed my Player by the move vector and the movement speed multiplied by time.deltatime.

This made my bird move automatically.

This is what Cine machine looks like in the Scene hierarchy and the inspector. It simply attaches to your camera, and you can make it follow your player.




Comments

Popular Posts