Search Unity

How Is It Possible to Set Transform Position/Rotation Without Notifying Its Children?

Discussion in 'Scripting' started by AhSai, Jul 21, 2019.

  1. AhSai

    AhSai

    Joined:
    Jun 25, 2017
    Posts:
    129
    The presenter from INSIDE in this talk (at 45:12) says that he made a function called SetLocalPositionNoNofity() where setting position of a parent transform that doesn't notify all other children. I am just wondering how is this done? Does anyone know about it?
     
    Last edited: Jul 22, 2019
  2. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,537
    At 44:10 he talks about how you can't really optimize setting position/rotation unless you have "source code access" (this is access to the actual source code behind the unity engine).

    He then goes on to talk about the methods they wrote to eek out extra speed. Including the 'SetLocalPositionNoNotify'.

    So he means these methods were created via source code access of Unity... something most of us don't have. It requires a special license from Unity that can only be purchased via direct negotiation with Unity. There's no pricing tier, and not everyone can buy it. It's on a case by case basis that you talk with them about.

    So just like how when you set the position, that property call gets pushed through to the Unity engine and it does some blackbox magic behind the scenes to update all Transforms that are children of it. They just wrote their own method on the source code side to do the same thing, but without updating the children, and uncovered it on the C# side as this 'SetLocalPositionNoNotify'.
     
    forestrf likes this.