Search Unity

Dynamic Rigidbody without outside forces

Discussion in 'Getting Started' started by xjjon, Feb 18, 2017.

  1. xjjon

    xjjon

    Joined:
    Apr 15, 2016
    Posts:
    612
    Perhaps I am tackling this the wrong way, but I want to have two rigid bodies be able to collide without applying force to each other (other than stopping).

    I am applying velocity to the rb's to control their movement. Problem is when two players collide with each other, one will push the other, especially if either player is idle.

    Can't use kinematic since then they won't collide with the walls and such anymore. So basically I want two rigid bodies to be affected by collisions but not be able to be pushed around.
     
  2. Pengocat

    Pengocat

    Joined:
    Dec 7, 2016
    Posts:
    140
    I suppose you could create a "Physic material" with a bounciness of 0 and a "bounce combine" set to "minimum".

    You can also make use of void OnCollisionStay(Collision other) where you could experiment with resetting the rigidbody velocity.
     
    Last edited: Feb 18, 2017
  3. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    I tend to use triggers for this. You have to then rewrite much of your own physics system. But it's not too difficult.