Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

i can change the tranform in loadscenemode. additive??

Discussion in 'Scripting' started by danchavil, Jul 19, 2018.

  1. danchavil

    danchavil

    Joined:
    Jul 12, 2018
    Posts:
    32
    Hello people,

    my question is, if i use loadscenemode.additive and i wish change the position in load the scene, i can chage it?

    example:

    i have a map in three scenes, the first appears in sector 1, the second in sector 2 and the third in sector 3. and i have an forth sector, but i wish load the scene that i have sector 1 in sector 4. loadscenemode have an option to load in specifics coordinates

    thanks for the help.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,517
    The scene manager doesn't know anything about this but the general way you do this is to make a single root object per scene that contains all the scene parts you want to move around, but perhaps not your camera and light, for instance. You can then tag or mark this object in some way specially so that you can find it and move it after the scene has finished loading.

    Keep in mind scenes don't load until the end of the current frame, so if you tell it to load scene, then go looking for the object right away, you won't find it. You need to yield a frame, then go looking.