Hello Everyone,
I am trying to make a game in which there are 2 cars translating towards each other and i want to show an animation(Light explosion) on collision.
I have written the following script:
function OnCollisionEnter(collision:Collision)
{
if(collision.gameObject.name == "car2")
{
//Play animation
animation.Play("Light explosion");
}
}
I have attached my script to game object.But animation doesn’t seem to work.Any idea???
Isn't the animation clip already present in animations?from where we need to drag and drop the animation?
– satya144From the Project view tab, wherever you created it originally in the Assets folder.
– KiloblarghI haven't created any animation,I want the inbuilt animations.
– satya144There are none such. there's certainly not a built-in animation called "light explosion". You are just confused and you need to stop and RTFM before you go any further.
– Kiloblargh