x


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..

more ▼

asked Nov 07, 2010 at 06:03 AM

Thet Naing Swe gravatar image

Thet Naing Swe
826 183 142 144

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Nov 07, 2010 at 06:17 AM

Eric5h5 gravatar image

Eric5h5
107k 51 180 648

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.

Nov 07, 2010 at 07:22 AM Thet Naing Swe

Strategy games are typically done using a grid, so you can check the grid position of each character in an array instead of using physics.

Nov 07, 2010 at 01:20 PM Eric5h5

Thanks.. I will try to calculate using grid...

Nov 08, 2010 at 06:16 AM Thet Naing Swe
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4003
x2975
x343

asked: Nov 07, 2010 at 06:03 AM

Seen: 4529 times

Last Updated: Nov 07, 2010 at 06:03 AM