Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: InbalTal on February 18, 2020, 05:22:58 AM

Title: <Advise>How to change Child GameObject location from one scene to another scene
Post by: InbalTal on February 18, 2020, 05:22:58 AM
 ???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
Title: Re: <Advise>How to change Child GameObject location from one scene to another scene
Post by: Thore on February 18, 2020, 06:50:58 AM
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.
Title: Re: <Advise>How to change Child GameObject location from one scene to another scene
Post by: InbalTal on February 18, 2020, 06:57:27 AM
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
Title: Re: <Advise>How to change Child GameObject location from one scene to another scene
Post by: Thore on February 18, 2020, 09:11:39 AM
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.
Title: Re: <Advise>How to change Child GameObject location from one scene to another scene
Post by: 600 on February 18, 2020, 10:42:44 AM
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.