x


Excluding some physics collisions

I have 3 object all have a collider and rigidbody. A, B and C.

A and C can physically interact

B and C can physically interact

A and B can't physically interact and should be able to go through each other

Is this possible to do? thanks.

more ▼

asked Mar 31 '12 at 06:01 PM

mustafa gravatar image

mustafa
17 3 3 5

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

3 answers: sort voted first

Use layers, or Physics.IgnoreCollision.

more ▼

answered Mar 31 '12 at 06:46 PM

Eric5h5 gravatar image

Eric5h5
80.1k 41 132 519

28 seconds to late! :(

Mar 31 '12 at 06:47 PM OrangeLightning

thanks Physics.IgnoreCollision works

Mar 31 '12 at 07:52 PM mustafa
(comments are locked)
10|3000 characters needed characters left

Well, you could use Layer-Based Collision Detection to make some object not collide with objects with a specific layer.

more ▼

answered Mar 31 '12 at 06:47 PM

OrangeLightning gravatar image

OrangeLightning
5.3k 47 57 111

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

This is really easy to do via the Layer Collision Matrix which is found in Edit-> Project Settings -> Phyiscs.

Create 3 layers for your A, B, C objects, then set up how they interact via the grid.

more ▼

answered Mar 31 '12 at 06:47 PM

Thom Denick gravatar image

Thom Denick
1.9k 13 20 38

Ha ha 58 seconds too late.

Mar 31 '12 at 06:48 PM Thom Denick
(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:

x2484
x1865
x1783
x1683
x51

asked: Mar 31 '12 at 06:01 PM

Seen: 595 times

Last Updated: Mar 31 '12 at 07:52 PM