Ignoring Annoying Collisions

Erm I have a weird problem.

I have a sphere and an empty inside the sphere which the camera follows. The Empty is the sphere’s parent.

The Sphere has a rotation script so it looks as if it’s rolling.

The Empty has an infinite move forward script and a steering script attached to drag the sphere.

The sphere has a rigid body for gravity and a collidor to stop it falling through the floor, but when it rolls off the side of the floor and falls,

the empty doesn’t fall with it because it doesn’t have a rigid body (because it would fall through the floor at the beginning of the game if it did.)

I can’t add a collider to the Empty (to collide with the floor) because the sphere already has one and they go retarded as the empty is in the sphere.

Don’t tell me to get rid of the empty and just have the sphere with the camera following it, coz trust me… u don’t want to know the horrors that go on.

I try the ignore collision in a weird way, but I don’t quite know how to use it when having an object and telling it to ignore another object’s collider…

help me - all I want is these 2 colliders to ignore each other so they can co-exist! If you understand…

p.s. I’m a newbie if u havent already guessed!

To make the 2 colliders ignore each other, use Physics.IgnoreCollision.

Physics.IgnoreCollision(collider1, collider2);

Thanks - I’ve thought about that before but I’m such a newb and I know it’s frustrating that I’m so stupid but-

What do I replace Collider1 and Collider2 with? Is it the collider of the sphere and the collider of the Empty? E.g. Sphere.collider?

thanks anyway

Without seeing your code, I can’t give you the exact line, but it will look something like:-

Physics.IgnoreCollision(sphere.collider, empty.collider);

Swap the names for whatever the sphere and empty object are actually called in your project.

Thanks and yeah they are actually just called sphere and empty but I’ll give it a try and experiment.