- Home /
triggering prefabs upon collision
so I've got the idea down of triggering an animation with an object when i hit it with another object.
i additionally want to trigger some "explosion" prefabs I've downloaded. they don't have animations attached so I'm not sure how to go about triggering these. they came in some explosion pack. do i add animations? i want to retain the dimensions and positioning of the explosion to the surface that will be "exploded" upon collision with another object.
Look around on the asset store, there are some nice packages for this.
Answer by Berenger · Mar 23, 2012 at 06:40 PM
Take every step one at a time :
http://unity3d.com/support/documentation/ScriptReference/Collider.OnTriggerEnter.html
http://unity3d.com/support/documentation/ScriptReference/Animation.Play.html
Particle system uses animations in the way that something is happening over time. But it's not animations in the way that you have an Animation component with a .animation asset. To make it play, either use emit = true; (I assume it's not shuriken) or just intantiate the prefab with emit already set to true.
Your answer
Follow this Question
Related Questions
Collision with terrain 0 Answers
Collision problem 0 Answers
switch object when collided with? 2 Answers
Objects Touching? 1 Answer
How to access a bool of a specific clone in a collision 1 Answer