playMaker

Author Topic: <Advise>How to change Child GameObject location from one scene to another scene  (Read 1245 times)

InbalTal

  • Junior Playmaker
  • **
  • Posts: 55
 ???HI,
I what to change Child GameObject location from one scene to Another GameObject in Different scene during play mode while press UI button
Is it possible?
If Yes, How am I do it

Thank's
Inbal
« Last Edit: February 18, 2020, 06:44:45 AM by InbalTal »

Thore

  • Sr. Member
  • ****
  • Posts: 480
The action is called Set Parent. It’s unclear what you mean by another scene. Presumably, you check for some condition that is unique in each scene, and set parent accordingly.

InbalTal

  • Junior Playmaker
  • **
  • Posts: 55
hi
I try to explain :
I have an empty game object that contains several game object.
during gameplay mode, I want to click UI Button and move this empty game object that contains several game object, to another scene - and place in to a specific Gameobject Folder in the new scene

Thank's

Thore

  • Sr. Member
  • ****
  • Posts: 480
Unity supports loading of several scenes, and it might be possible to load one, make changes and unload it, but it looks like it’s the wrong approach.

I think you should store the objects in question in global variables or player preferences, destroy/deactivate  them in the current scene and instantiate them as soon you enter the new scene. A more robust way to this might be writing the objects into a scriptable object, and then load them from that scriptable object again.

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Could use "Dont Destroy On Load" so it stays on any scene loading or if both scenes are loaded then "Move Game Object To Scene", not sure if its from Ecosystem or in original actions.