Search Unity

Sliding to sensitive

Discussion in 'Physics' started by ChipotleGod, Aug 11, 2020.

  1. ChipotleGod

    ChipotleGod

    Joined:
    Jul 20, 2020
    Posts:
    48
    So i have 2 boxes and one is a player. When the obstacle (Thing falling from the sky) lands on the player and I go back and forth the obstacle slides off to easy how do I make it stick a bit more ro the player and make both the player and the obstacle be less slipperey when moving
     

    Attached Files:

    Last edited: Aug 11, 2020
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,473
    Use PhysicsMaterial2D with Friction set to a value you requireand assign to the Rigidbody2D/Collider2D in question.
     
  3. ChipotleGod

    ChipotleGod

    Joined:
    Jul 20, 2020
    Posts:
    48
    Do i assign it to the player or the obstacle?
     
  4. ChipotleGod

    ChipotleGod

    Joined:
    Jul 20, 2020
    Posts:
    48
    Because ive tried both and the obstacle still slips off the player way to easy. But thanks to your tip the player does move better. I am still confused though on how to make the obstacle slip off the player harder.
     
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,473
    It will make a huge difference unless you're not letting physics do the movement and are doing stufflike modifying the Transform which you should never do.