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.

Question CopyPhysicsVelocityToSmoothing jobs in 0.51

Discussion in 'Physics for ECS' started by argibaltzi, Jul 28, 2022.

  1. argibaltzi

    argibaltzi

    Joined:
    Nov 13, 2014
    Posts:
    218
    Hi
    Since the AddInputDependency has been removed, i am struggling to do something specific with jobs.

    I am doing some explosion jobs which modify velocities on newly created objects. In the old way i would schedule the jobs to complete before CopyPhysicsVelocityToSmoothing.

    First explosion job would be scheduled like this
    JobHandle handle1 = buildPhysicsWorld.GetOutputDependency();
    JobHandle handle2 = exportPhysicsWorldSystem.GetOutputDependency();
    JobHandle = combine1and2JobHandle.CombineDependencies(handle1, handle2);
    JobHandle newJobGroup = job.Schedule(combine1and2);


    And at the end:
    copyPhysicsVelocityToSmoothingRef.AddInputDependency(Dependency);
    endFramePhysicsSystem.AddInputDependency(Dependency);


    How do i do this now?
    The RegisterPhysicsRuntimeSystemReadWrite does what exactly for such a case?

    Thank you!
     
    Last edited: Jul 29, 2022