playMaker

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

InbalTal

  • Playmaker Newbie
  • *
  • Posts: 47
    • View Profile
 ???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, 04:44:45 AM by InbalTal »

Thore

  • Sr. Member
  • ****
  • Posts: 439
    • View Profile
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

  • Playmaker Newbie
  • *
  • Posts: 47
    • View Profile
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: 439
    • View Profile
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: 629
    • View Profile
    • 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.