- Home /
Strange issue with collider
Hey guys, I am trying to call a function when Object A hits Object B. But OnColliionEnter does not work while OnControllerColliderHit works. I am slowly going nuts, because I have tried everything. Made thee OnCollisionEnter public and private. Doesn't work. I need to use the OnCollisionEnter method, because I am trying to substract a Healthpoint everytime an Enemy hits the Player. I also tried adding other colliders to my Gameobjects, doesn't work. Tried different tags, doesn't work. I'd be very happy if someone could tell me what I am doing wrong :-)
Answer by Vega4Life · Jul 20, 2019 at 01:37 AM
Make sure you have colliders on both objects (they can't be ticked as triggers). One of those objects needs to have a rigid body. That basic setup will always call OnCollisionEnter.
Your answer
Follow this Question
Related Questions
2D Platformer - Action When Key Is Pressed During Collision C# 0 Answers
How to get OnTriggerEnter effect without using isTriggered on Collider? 1 Answer
Rigidbody trapped in collider after collision 1 Answer
Why there is no Collider.IsTouching(...) ? 2 Answers
Why when i move the player object through the door the ontriggerenter/exit event are not fire ? 2 Answers