Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: heavygunner on December 05, 2018, 10:23:16 PM
-
Hi !
I made a casual game with 20 levels. 20 scenes.
I created UI only for one scene so far. Also UI , Camera & another GameManager (with lot of FSM) should be common for all scenes.
I made prefab of both UI, Camera & game Manager and put on all other scenes. it not worked. It gave so much "missing target" error. (GameManager has an FSM to enable * disable UI screen)
Ya ! Entire project ruined >:( >:( >:( >:( . Now I loaded backup project. How can I put the UI, Camera & Game Manager to all other scenes?
Thanks
-
However, Well, I tried Don'tDestroyOnLoad. But, I didn't made it.
However, I m gonna redesign 20 levels again (won't take more than an hour) with new UI.
But, still looking for easiest solution
-
Hi,
you have likely hardcoded references of gameobjects so when you move scenes, it looses the references.
make one scene for your UI and load that scene additively, then create a system so that it can communicate without hard reference but instead find gameobjects by tag or within a look up list available on each scene.
Bye,
Jean
-
I don't know if it's bad practice, but things that will be used in all scenes you could put under one prefab, references inside the same prefab should work.
I like it mostly because rolldown menus are way more convenient when sending and getting variables between objects.
Something I'm curious about is how Unity works if you do a 'find game object' on the first frame when the game startup is there a chance the object hasn't been created in the scene yet? Or do Unity create all objects, then starts running through scripts/components?
-
Hi.
Load scene additive would be a good way to go like jean suggested.
Here's a tutorial about load scene async additive :
-
Hi.
Load scene additive would be a good way to go like jean suggested.
Here's a tutorial about load scene async additive :
Hi !
Thank you :)
It worked.
I added DontDestroyOnLoad to Gamemanager & other necessary objects.
But, I have a Restart Function too. If Player lost, he can Restart level. Once Restarted Level, I see objects I added DontDestroyOnLoad doubled. Everything doubled. How can i fix it ?
-
Hi.
Load scene additive would be a good way to go like jean suggested.
Here's a tutorial about load scene async additive :
Hi !
Thank you :)
It worked.
I added DontDestroyOnLoad to Gamemanager & other necessary objects.
But, I have a Restart Function too. If Player lost, he can Restart level. Once Restarted Level, I see objects I added DontDestroyOnLoad doubled. Everything doubled. How can i fix it ?
I searched on Ecosystem for SINGLETONE . Got no results.
Found it after spelled correctly.
But, I don't know how to use it. Will try and update thread later
-
This method is working well. Even Singleton.
Unfortunately, The way I designed game is not compatible with these action. I have 20 Scenes, Each scenes had different Small maps. Each map has 10 Spawn points. So, FSM losing reference to spawn points upon restart & Load next levels.
So, Again I have to resume redesign the levels.
Thank you for everyone's input. learned important things today.
-
Hi.
Maybe you can use arrays or array maker to place the spawn points in.
-
Oh !
I did manually :D
Will use this in future if wanted.
thank you very much