Search Unity

I updated to .50, but my collision & trigger scripts failed

Discussion in 'Physics for ECS' started by goodnewsjimdotcom, Apr 14, 2022.

  1. goodnewsjimdotcom

    goodnewsjimdotcom

    Joined:
    May 24, 2017
    Posts:
    342
    Here's the code that failed: https://pastebin.com/VFW4L0AE

    It seems only my update it wasn't happy on:

    protected override void OnUpdate()
    {
    System.TimeSpan t;

    rightNow2 = System.DateTime.Now.Ticks;


    Dependency = new CollisionJob()
    {


    ed= GetComponentDataFromEntity<EntityData>(true),
    td = GetComponentDataFromEntity<Translation>(true),
    commandBuffer = _endSimEntityCommandBufferSystem.CreateCommandBuffer(),
    rightNow = rightNow2,

    playerEntity=GameBoardModel.playerEntity
    }.Schedule(_stepPhysicsWorldSystem.Simulation, ref _buildPhysicsWorldSystem.PhysicsWorld, Dependency);

    _endSimEntityCommandBufferSystem.AddJobHandleForProducer(Dependency);



    }
     
  2. goodnewsjimdotcom

    goodnewsjimdotcom

    Joined:
    May 24, 2017
    Posts:
    342
    What is the way people are doing collisions/triggers now?

    Thank you,
    Jim
     
  3. papopov

    papopov

    Joined:
    Jun 29, 2020
    Posts:
    32
    Are you getting some errors? If so, it would be helpful to share :)
    Or is it just not working?
    In any case, sharing the entire system code will make troubleshooting easier.
     
  4. goodnewsjimdotcom

    goodnewsjimdotcom

    Joined:
    May 24, 2017
    Posts:
    342
    I was told that Unity has updated their github code. EntityComponentSystemSamples-master\PhysicsSamples for .5. My plan is to dissect their code and integrate my code into it. I got this plan from the helpful guys on Unity's official DOTS Discord.
     
  5. JMPM-UNITY

    JMPM-UNITY

    Unity Technologies

    Joined:
    Jun 16, 2021
    Posts:
    94