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.

Bug Unity.Physics.Material > FRICTION ignored?

Discussion in 'Physics for ECS' started by Goularou, Apr 11, 2022.

  1. Goularou

    Goularou

    Joined:
    Oct 19, 2018
    Posts:
    44
    I keep trying to set up the friction of my entity, but it appears that it is not taken into account.

    Code (CSharp):
    1.  
    2. Unity.Physics.Material physicsMaterial = new Unity.Physics.Material
    3.             {
    4.                  CollisionResponse = CollisionResponsePolicy.CollideRaiseCollisionEvents,
    5.    Friction = 0.9f,
    6.    Restitution = 0.01f
    7. };
    8.  
    9. BlobAssetReference<Collider> blobCollider =
    10.    Unity.Physics.ConvexCollider.Create(verts, ConvexHullGenerationParameters.Default, collisionFilter, physicsMaterial);
    11.  
    12. ecb.SetComponent<PhysicsCollider>(entity, new PhysicsCollider { Value = blobCollider });
    13.            
    When using 0f for the Friction, it does behave normally (like ice), BUT using 1f does not change the behavior: it looks like it is either ignored and/or using Default, as it keeps sliding (while the mass is rather low).

    Thanks in advance.
     
    Last edited: Apr 11, 2022
  2. Goularou

    Goularou

    Joined:
    Oct 19, 2018
    Posts:
    44
  3. JosepMariaPujol

    JosepMariaPujol

    Unity Technologies

    Joined:
    Jun 16, 2021
    Posts:
    77
    Hi, Goularou could you please submit your Unity project so we can investigate this further.

    Thank you!