Search Unity

Question Need help to prevent transfer of Velocity/momentum between rigidbodies

Discussion in 'Physics' started by tcarp, Jun 2, 2021.

  1. tcarp

    tcarp

    Joined:
    May 16, 2020
    Posts:
    6
    So my scenario is this, I'm making a side scrolling platformer, but in 3d space rather than 2d. I I have a moving platform that the player needs to get on. However when the platform changes direction, the player maintains and is thrown in whichever direction the platform was moving in last.

    How can I make it so that when the platform they're standing on changes direction, the player isn't thrown away?

    The platform is being moved using rigidbody.MovePosition().

    Thank you,
     
  2. Geckoo

    Geckoo

    Joined:
    Dec 7, 2014
    Posts:
    144
    Maybe you could set your player as a child of the platform - now its parent - and using ColliderStay(). When you jump or leave platform, player.SetParent(null).

    Also you should take a look at your physic material. It seems to me that you have something more or less similar with an ice block. Set friction ans static friction to 1.

    https://docs.unity3d.com/Manual/class-PhysicMaterial.html
     
    Last edited: Jun 2, 2021