x


Ignoring collisions with...everything

I know of the Physics.IgnoreCollision function, but is there a way to just simple....ignore every collision? Or disable the collider mesh in code?

more ▼

asked Mar 25 '10 at 07:22 PM

Kith gravatar image

Kith
526 27 28 38

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

1 answer: sort voted first

If you still want to check if an object collided to another but don't want the physics to react with the object then you check or enable the "IsTrigger" in the Inspector.

through the code it would be:

function Update() {
    collider.IsTrigger = true;
}

Hope that helps.

more ▼

answered Mar 25 '10 at 07:48 PM

Tuti gravatar image

Tuti
410 1 3 9

Thanks! Never even thought of that lol.

Mar 25 '10 at 07:54 PM Kith

Just an fyi, you shouldn't be setting collider.isTrigger inside of the Update loop as it occurs every frame. instead set it in either Awake() or Start()

Mar 25 '10 at 08:14 PM equalsequals

Yeah I figured lol. I just set it once in an appropriate function and it's working fine.

Mar 25 '10 at 08:22 PM Kith
(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:

x2507
x1707
x216

asked: Mar 25 '10 at 07:22 PM

Seen: 717 times

Last Updated: Mar 25 '10 at 10:04 PM