How to create a camera animation using SPLine in Unity?

spline camera animation in unity3d

Games are pure entertainment and with game engines getting advanced, a lot of theatrical effects are getting common everyday. One of them is the camera movement across a game environment. Camera movements are extremely important. They add as an important element to interpret and enjoy the game from a whole new level. But how do be create one? This free Unity3D Scripting tutorial can help.

You can create a camera animation using SPLine in Unity game engine. First download the SPLine package controller and have it by your side.

Go to Unity Game engine and open the controller. You will come across a number of factors to create your camera animation loop for any specified game object you desire. Set the SPLine root to game object and the required duration too. Set ‘orientation mode’, ‘wrap mode’, ‘auto start’, ‘auto close’ and ‘hide on execute’. Add the script to the object after you have set all the parameters.

The next thing to do is to create an SPLine Root –

  • Create a cube or any basic shape from hierarchy panel.
  • Set this cube as SPLine point. Make sure to set rotation of the object during the camera animation if you intend to.
  • Set points(cube or game objects) as per your path.
  • Create a parent object of SPLine points.
  • Assign this parent object in Spline controller script in “Spline Root”.

And that’s it, you have created your own camera animation. Next, time we would give you Unity3D game source code for creating an infinite 2D map in Unity. Till then, run some mocks to create your own camera animation.

Leave a comment