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.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

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:
    305
    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:
    305
    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:
    305
    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. JosepMariaPujol

    JosepMariaPujol

    Unity Technologies

    Joined:
    Jun 16, 2021
    Posts:
    77