I want to select my collision object in the inspector so it would be easier.
This is the script I attached to my Capsule.
public var animationName : String;
public var collisionObject : GameObject;
function OnCollisionEnter(theCollision : Collision){
if(theCollision.gameObject.name == collisionObject){
animation.Play(animationName);
}
}
Why isn’t my animation playing when colliding? It does work when I fill in the collision object by hand.