- Home /
Can you help me about a animation ?
Hey every body, can you help me please, it's about a death of my character, i give him this code :
void OnCollisionEnter2D (Collision2D Finish) { if(Finish.gameObject.tag == "Obstacle" ) { anim.SetTrigger("Death"); Application.LoadLevel (Application.loadedLevel);
}
}
and this characteristic
and i want, when the main character touch obstacle, we seen a character dead, after 2 second the game replay, now directly in the early of the game we can see the main character transform to character dead please help me it block me (sorry for my english, i'm not bilingual) thank you
Answer by malkere · May 09, 2015 at 01:11 AM
you need to use Debug.Log to find out what is going on as with all coding problems. If it is dying too early is must be colliding with something find out what collider is causing it with a Debug.Log(Finish.name); and go from there.
Your answer
Follow this Question
Related Questions
Compiler error while trying to access a Collider's script. 1 Answer
Multiple Cars not working 1 Answer
Raycast doesn't collide as it should 1 Answer
Error CS1061 I can't find a solution! [C#] 1 Answer
Distribute terrain in zones 3 Answers