How to create an Angry Bird like projectile in Unity

angry bird

If you studied some science in school, you must have come across projectiles. Simply explained, projectiles are parabolic paths travelled by objects in a given space. On earth, projectiles are extremely common. We come across them everyday. Be it a small asteroid falling on earth or a stone shot from a slingshot- they are all different types of projectiles.

Angry Bird uses exactly the same principle as one of the key elements in the game. The birds launched from the slingshot are programmed according to the laws of physics. Unity allows developers to employ all fundamental laws of physics and create any effect desired including projectiles too.

-> Understanding this free unity3d scripting tutorial

To apply the effect, we are going to use the formulae for projectile motion. These are

Vx = V0x t

Vy = V0y t – ½gt2

where Vx is Distance in X Direction at given time t, and Vy is Distance in Y Direction in given time t.

The next step is to make points across a time interval. All these would make a complete projectile that we can set for the object to follow.

You can also set the force of the object manually in Unity and get the desired effect with the object. You can also apply vectors in the rigid body in Unity. Go through the tutorial yourself and try to make your own projectile in Unity.

Next time, we would discuss, how to create flowing liquid in Unity using particles. Till then, you can stop playing angry bird for a while and give this tutorial a try. Have a great day!

Related: Download Free eBook: Mobile Game Launch strategies

Leave a comment