Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Transform.SetPositions(Transform[], Vector3[])

Discussion in 'Experimental Scripting Previews' started by laurentlavigne, Mar 9, 2017.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,365
    I noticed that updating N entities' transforms by hand is more time consuming than having N entities move by navmesh so I'd say the managed->engine tax is very costly.
    Are you guys working on exposing a method to get/set arrays of transforms?
     
    strich likes this.
  2. GabrieleUnity

    GabrieleUnity

    Unity Technologies

    Joined:
    Sep 4, 2012
    Posts:
    116
    Hello, we are working on multiple improvements that will, directly and indirectly, improve considerably the speed of updating positions of multiple transforms in one go. I still don't know when these improvements will land, though.

    Having an API like the one u described above makes sense, so we might end up exposing something similar in case the other solutions will take longer than expected to be released.
     
    Flavelius and strich like this.
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,365
    Very nice, not a fan of optimize early here, but I'm leaning away from Update on every object and centralizing systems usually means updating all entities at once anyway. Take your time to make it good :)
     
  4. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    967
    Cool, looking forward to it! My simulation is heavily bound by setting transforms..
     
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Check out the preview for the job system from the latest Unite. The example is setting the position and rotation of a massive amount of transforms, really fast. It's even happening on it's own thread!
     
  6. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    967
    Thanks for posting the video. Now I really can't wait! I thought the job system already dropped in 2017, but it seems it's in 2017.3