Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question FPS Controller Jumping on Objects Issue: RigidBody Setup

Discussion in 'General Discussion' started by wuannetraam, Jan 15, 2023.

  1. wuannetraam

    wuannetraam

    Joined:
    Oct 29, 2019
    Posts:
    87
    I am working on a FPS Controller. It's a RigidBody setup. Everything works as it should except for the Jumping on objects part. In the video you can see what is happening. To fix this I can put a physics material on the crate with 0 friction. But when I run against the Crate it will slide of the floor like it is on ice. The same for when the player stand on top of the crate it will slowly slide of it.
    So I am stuck on what to do now.. I think this is a physics things


    https://drive.google.com/file/d/1_FoS-ME4MkpXgAid_kNSD8vQqa-tU77C/view?usp=sharing
     

    Attached Files:

  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,745
    ...what did you expect to happen? 0 friction means there's no friction being applied. You're sliding around because you literally can't do anything but.
     
  3. wuannetraam

    wuannetraam

    Joined:
    Oct 29, 2019
    Posts:
    87
    I did not apply a physics material with a friction of 0. If I would do that then the player hanging on to the crate will be fixed. But then the other problems occur.
     
  4. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    1,459
    There's a "trick": Use two colliders for the player. One which is a bit wider but not as tall, meaning it covers the character roundaround, but at the bottom of the character, the primary collider is showing. Then give the wider collider a material with no friction and the main collider whatever friction the "feet" shall have.
    That way you can nicely jump along walls and crates and yet are not sliding around otherwise.
     
  5. wuannetraam

    wuannetraam

    Joined:
    Oct 29, 2019
    Posts:
    87
    that is what I had previously as my setup but I ran in to problems with stairs. The player kept sliding of it. People recommended me to use only a capsule collider and put 0 friction on walls.
     
  6. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    486
    On the player material set Friction Combine to minimum.
    edit: And this material should only be used for player not world objects.