x


how to detect Collision with out having a RigidBody ?

how to detect Collision without assigning rigidBody?

more ▼

asked May 04 '12 at 01:59 PM

xtplpune gravatar image

xtplpune
16 10 13 16

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

2 answers: sort voted first

Its very easy. Actually rigid bodies are used to make your object be influenced by physics forces, like gravity, acceleration and etc. You can detect collisions using both rigid bodies or box colliders. Just search for Box Colliders on Unity documentation and you will have a very nice example.

http://unity3d.com/support/documentation/Components/class-BoxCollider http://unity3d.com/support/documentation/ScriptReference/Collider.OnCollisionEnter.html

more ▼

answered May 04 '12 at 04:03 PM

ronaldosilva gravatar image

ronaldosilva
34 3 7 10

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

Thanks For Helping..... But i want to detect Collision when two cubes(they don't have RigidBodies) are touched......

But In Reference... If you are moving an object through its Transform component but you want to receive Collision/Trigger messages, you must attach a Rigidbody to the object that is moving.

means,for detecting collision, is Rigid Body is must and should ?

more ▼

answered May 08 '12 at 10:34 AM

xtplpune gravatar image

xtplpune
16 10 13 16

You do not need to have a RigidBody unless you want to use Unity's physics to handles collisions.

Look at the links provided by ronaldosilva. You can attach a Collider to your game object to detect collisions and handle the response yourself in OnCollisionEnter().

May 08 '12 at 10:39 AM centaurianmudpig
(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:

x2482
x1781

asked: May 04 '12 at 01:59 PM

Seen: 511 times

Last Updated: May 08 '12 at 10:39 AM