Search Unity

Objects with colliders doesn't collide with each other

Discussion in 'Physics' started by DeanAseraf1, Aug 25, 2019.

  1. DeanAseraf1

    DeanAseraf1

    Joined:
    Aug 3, 2018
    Posts:
    16
    Hey
    I've just created a new seance and added a box as a floor and a sphere.
    I also added a box collider to the floor, a sphere collider and a rigidbody to the sphere to add gravity.
    For some reason the two objects doesn't seem to collide with each other.
    anyone have an idea why this is happening?
     
  2. Adien22

    Adien22

    Joined:
    Aug 19, 2019
    Posts:
    44
    I'd need to see the set up to know for sure. It could be any number of things potentially. you could have 1 or both of them set as a trigger, or did you add any other scripts to the game? and when you say they don't collide, do you mean they pass through each other or they just stay in place and don't move at all never touching?
     
  3. DeanAseraf1

    DeanAseraf1

    Joined:
    Aug 3, 2018
    Posts:
    16
    Ok so, none of them is set at a trigger,
    I didn't added anything else to the game project except the two objects
    what i ment is that they pass through each other.
    thank you so much
     
  4. alexeu

    alexeu

    Joined:
    Jan 24, 2016
    Posts:
    257
    Try setting the Collision Detection of the Rigidbody to Continuous Dynamic
     
  5. Adien22

    Adien22

    Joined:
    Aug 19, 2019
    Posts:
    44
    try what alexeu said first. but if that doesn't work, try setting the density and gravity to 1, then decrease the size of the collider and increase the edge radius to fit the box and sphere. I had the same problem every now and then in my platformer game I'm making right now. my boxes would randomly shoot through the floor. I read it was because the physics engine can't detect object going too fast. so I set everything low and increased the size of the colliders and it fixed it. But as I said, the above comment should also fix your particular problem if it isn't a speed issue
     
  6. arfavorito42

    arfavorito42

    Joined:
    Dec 16, 2018
    Posts:
    1
    Your objects may not be able to collide with one another because the might have the wrong colliders attached to them check to see if you selected the correct one in the inspector panel