Question by
SuzukaChan · Mar 04, 2017 at 11:57 PM ·
character controller
when a character controller was collider with another character controller, the second controller destroy.
void OnTriggerEnter(Collider col) { if (col.gameObject.tag == "Player") { print("you have hit by enemy"); Destroy(col.gameObject); } }
mine does not work, even did print the message;
Comment
Answer by justinsykes2006 · Aug 30, 2021 at 02:28 PM
It should be OnCollissionEnter I believe, although Im a bit late to reply.
Your answer
Follow this Question
Related Questions
Help with a simple jump script 1 Answer
Default character animations allowing for custom skins 0 Answers
How do i make my 2D character jump by touching the screen? 1 Answer
Player keeps flying up 0 Answers
character using character controller jittering on IOS mobile device but not Unity Editor 1 Answer