- Home /
onCollisionEnter doesn't work without RIgidbody?
Hi, I am trying to check the collision between two colliders and OnCollisionEnter() doesn't work unless one of the object is RigidBody. I can't use Rigid Body for all the objects as it's a way expensive....
Also tried with trigger and it doesn't work without Rigidbody too.... Anyone helps me..
Answer by Eric5h5 · Nov 07, 2010 at 06:17 AM
Correct. As shown in the docs, in order for anything to generate OnCollision events, one of the two objects involved must be a rigidbody. There's no way around that. You don't put a rigidbody on everything, just the objects that move.
So.. How about doing something like strategy games? there will be hundreds of moving characters and putting rigidbody on each character will be alot expensive.
Strategy games are typically done using a grid, so you can check the grid position of each character in an array ins$$anonymous$$d of using physics.
But I need two colliders to tell me when they collide. One is a rigidbody.
Yea but i have a problem, i have 2 gameObjects, both have Colliders and Rigidbody, but they don´t trigger the OnCollision event, why is it?
Your answer
Follow this Question
Related Questions
Collision Only being detected on one of the objects involved in the collision - C# 0 Answers
what object hit me? easy rigidbody question 1 Answer
A bit confused with OnCollision and Rigidbodys 0 Answers
Further collision beyond the OnCollisionEnter() event 1 Answer
Getting OnCollisionEnter to fire on composite object 2 Answers