Search Unity

[Bug] UnityPhysics erroring out when there are no Dynamic objects in the scene

Discussion in 'Physics for ECS' started by Srokaaa, Mar 15, 2020.

  1. Srokaaa

    Srokaaa

    Joined:
    Sep 18, 2018
    Posts:
    169
    Hey, I get a minor bug with 0.3.0-preview.1 version of UnityPhysics. When there are no DynamicObjects in the scene I get following error every frame when I try to use ICollisionEventsJob:


    InvalidOperationException: The NativeContainer DetectCollisionsJob.EventReader.m_InputVelocities has not been assigned or constructed. All containers must be valid when scheduling a job.
    Unity.Jobs.LowLevel.Unsafe.JobsUtility.Schedule (Unity.Jobs.LowLevel.Unsafe.JobsUtility+JobScheduleParameters& parameters) <0x166f1a660 + 0x0006a> in <ffaed69ce5944ce8987cd31c4b17b263>:0
    Unity.Physics.ICollisionEventJobExtensions.ScheduleUnityPhysicsCollisionEventsJob[T] (T jobData, Unity.Physics.ISimulation simulation, Unity.Physics.PhysicsWorld& world, Unity.Jobs.JobHandle inputDeps) (at Library/PackageCache/com.unity.physics@0.3.0-preview.1/Unity.Physics/Dynamics/Simulation/ICollisionEventsJob.cs:79)
    Unity.Physics.ICollisionEventJobExtensions.Schedule[T] (T jobData, Unity.Physics.ISimulation simulation, Unity.Physics.PhysicsWorld& world, Unity.Jobs.JobHandle inputDeps) (at Library/PackageCache/com.unity.physics@0.3.0-preview.1/Unity.Physics/Dynamics/Simulation/ICollisionEventsJob.cs:40)
    Arc.Damaging.DamageSystem.OnUpdate (Unity.Jobs.JobHandle inputDeps) (at Assets/Scripts/Arc/Damaging/DamageSystem.cs:38)
    Unity.Entities.JobComponentSystem.Update () (at Library/PackageCache/com.unity.entities@0.6.0-preview.24/Unity.Entities/JobComponentSystem.cs:129)
    Unity.Entities.ComponentSystemGroup.UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.6.0-preview.24/Unity.Entities/ComponentSystemGroup.cs:182)

    Otherwise everything works cool with new package and the new addition of parenting static objects is a lifesaver
     
  2. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    Hey, thanks for reporting, looking into it!
     
    Srokaaa likes this.
  3. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    This has been fixed and will be available in the next release. Thanks again for reporting it!
     
    Srokaaa likes this.
  4. Srokaaa

    Srokaaa

    Joined:
    Sep 18, 2018
    Posts:
    169
    That was quick, thanks :)
     
    petarmHavok likes this.
  5. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    Do you need a workaround in the meantime? It shouldn't be long before we publish it, but still...
     
  6. Srokaaa

    Srokaaa

    Joined:
    Sep 18, 2018
    Posts:
    169
    I just add one very very small dynamic object very very far it works fine
     
    petarmHavok likes this.