Search Unity

Bug Character feet slipping while colliders set for maximum friction?

Discussion in 'Physics' started by CloudyVR, May 14, 2023.

  1. CloudyVR

    CloudyVR

    Joined:
    Mar 26, 2017
    Posts:
    715
    Hello, I just upgraded my Unity 2019 project to Unity 2023 so I can start using ArticulationBody components, after many hours creating models and setting up IK I finally was ready to start training a AI, but when I created a training environment by simply rotating a floor with Perlin noise in FixedUpdate() I can see my character is sliding all over: slip.gif
    This makes training the AI impossible since I have never seen feet slip like this in real life. The simulation is not accurate to real life and I don't know what to do to make the feet stay in place when contacting the ground.

    I have tried adding physic material for floor and feet and setting the highest possible friction values:
    floor.png

    My character now walks like the floor is made of duct tape or fly paper yet slips around whenever the floor angle changes.

    Is there any way to solve this? I am using Unity 2023 is there possibly a bug in the engine or ArticulationBody??

    [edit]
    I have tried both SphereCollider and BoxCollider components, the BoxCollider has more grip but also readily loses traction on continuously rotating floors.
     
    Last edited: May 14, 2023
  2. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    868
    Is the floor a rigid body which you rotate by adding force/torque? If not, consider doing so to get more accurate physics simulation/ friction.
     
  3. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,929
    Make sure you're not rotating/translating the floor by directly setting its transform values. As far as the physics engine is concerned, that's basically teleporting the floor to a new pose, no velocities involved, hence no friction.

    You should either use forces/torques, or use Rigidbody.MovePosition/MoveRotation.