Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Problem with collider not ignoring collisions

Discussion in 'Physics' started by soopx, Apr 25, 2021.

  1. soopx

    soopx

    Joined:
    Apr 3, 2021
    Posts:
    3
    I have a game wth a car that follows a rigidbody sphere using transform.position. Everything works great, but I wanted to add a box collider to the sphere so that I can interact with obects more realistically within the game world.

    So I added a box collider as a child object to the sphere, created a new collision layer called "ignore", and set that to ignore ground. Except it wouldn't ignore the ground at all. I set that collision layer not to have collisions with any other layer, including itself, but it does.

    When you play the scene and the box collider is present, the car will not move
    If you then disable the box collider, you can drive around as normal
    if you re-enable the box collider once the game has started, you can move around, but now the car behaves very differently, getting stuck on objects, reduced speed in reverse somehow.
    The only difference in this behavior is whether the box collider, assigned to a collision layer which doesn't interact is enabled or disabled.

    The only advice I can find online are mismatches between the 2D and 3D collision matrix (I'm using 3D only and everything is correct in the matrix) or people using collision masks that override the physics settings, which I'm not using. What's happening here? Is the box collider inheriting properties that I can't see somehow? This isn't the behaviour I'd expect to see.