Search Unity

Resolved [Burst Bug] Zero friction / infinite sliding without "Domain Reload"

Discussion in 'Physics for ECS' started by Dinamytes, Mar 14, 2021.

  1. Dinamytes

    Dinamytes

    Joined:
    Nov 3, 2016
    Posts:
    51
    Entering play mode after the first time will cause the physic bodies to act something like they don't have friction, sliding forever, If "Enter Play Mode Options" is enabled without "Domain Reload".

    I'll try to post a video tomorrow.
    @0.17.0-preview 41 Entities
    @0.6.0-preview 3 Physics

    Edit:
    The problem was:
    MeshCollider.Create() without using the material overload, giving different friction results.
     
    Last edited: Mar 14, 2021
  2. milos85miki

    milos85miki

    Joined:
    Nov 29, 2019
    Posts:
    197
    Hi @Dinamytes-Gabriel_Mota , could you please clarify? Did you fix the problem in your code or you're saying that Material.Default has different values depending on "Enter Play Mode Options"?
     
  3. Dinamytes

    Dinamytes

    Joined:
    Nov 3, 2016
    Posts:
    51
    Hi milos,
    I tried to reproduce again and saw it only happens with Burst Enabled.
    Code (CSharp):
    1.                 var mat = Unity.Physics.Material.Default;
    2.                 Debug.Log($"{mat.Friction}");
    First play it logs 0.5f, next plays it logs 0.

    Created a
    Code (CSharp):
    1. public static readonly Unity.Physics.Material test = new Unity.Physics.Material() { Friction = 1 };
    and the same happens.
    Created a custom struct to test the same behaviour, with only 1 float inside it didn't happen, created 1 struct with the same Unity.Physics.Material variables and it did happen, it resets to default.
    I'll report to a Burst forum instead.
    Thanks
     
    Last edited: Mar 16, 2021
    milos85miki likes this.