Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: PET on July 13, 2016, 05:57:40 AM
-
Hey there,
I'm loading a leve async... however as soon as the loading finishes the level automatically changes. Is there a way to only trigger the loading change when I tell it to?
Thanks
-
I would also like an answer to this question as I am having the same issue.
-
:-[ :'( :'(
-
Is this really not possible?
-
Have you had a look on google first?
http://answers.unity3d.com/questions/137261/loading-level-async-without-switching-the-level-im.html
there is plenty of info on this
-
hi,
Yes, this is going to be a problem right now. The best solution is to have an fsm inside each sublevel you are loading and have then send a custom global event "ON SUB LEVEL LOADED" and you can even pass some data to it with the name of the scene just loaded. That would be how I would do this personally.
To make sure this is efficient, have this on a dedicated dummy GameObject, and once you have broacasted that event, destroy it, so that if you load it again, you won't have possible duplicates and similar issue.
Bye,
Jean
-
Hey Jean,
So let me see if I understand.
I have 3 scenes that I'm loading async ... each scene after another.
01 -> 02 -> 03
On the 2nd scene when loading the 3rd one I want to wait until the level change. I want to immediately load the 3rd scene, but I don't want it to automatically change when the 3rd scene is loaded. I want to press a button in Scene 2, and when I press that button go to scene 3.
You are suggesting to make a GameObject with a FSM on scene 3, create a custom global event called "ON SUB LEVEL LOADED" ... and when the scene 3 will load, it will send that custom global event. I can use "Broadcast All" I guess?
But... how do I stop Scene 2 FSM to not change the scene when the Scene 3 loads? Also, how do I change to Scene 3 when I want it? With what event?
I could use Loaded Event from the "Load Event" action, go to a state where I wait for the ENTER key, and when that key is pressed go to a state that changes the levels, but what action do I use there?
I hope I made myself clear.
Thanks Jean.
-
Hi,
that's already down to y custom implementation.
If scene two is listening to sub level loading, it can then disable some features when it detect that level 3 is loaded. that would work very well.
I would organize your levels by number but also by depth, level 3 is depth 3, so from level 2, if you want to load another level that would be like level 3 but a variant, I would suggest that you also set n int data on the global event for sub leve loaded to keep track of the depth.
so when you load 01, the even has a string "01" and an int '0', when it loads "02", the event will have string "02" and an int set to '1', etc etc
so now you have two different information from your level loading system, one is the name, one if the depth, and with this, I am positive that within level2 you can then listen to all new sub level loaded an act accordingly.
Bye,
Jean
-
Damn. This is a bit to complicated. Isn't there a way to do it easier?
http://docs.unity3d.com/540/Documentation/ScriptReference/AsyncOperation-allowSceneActivation.html
There have to be some stuff that could be added in PlayMaker... like a checkbox or something :D
-
Hi,
Actually, my solution would be actually easier then implement asynch operations, even with proper wrappers so you don't have to code anything. Because you'll end up having to build a game manager for your level loading and this general means lots of extra work to cover every case in a generic way.
But, you have a good point actually, I meant to tackle the new SceneManager scope of functionnalities, it's something that I indeed think we should support fully.
I created a Task on Trello (https://trello.com/c/LichVuvn/164-unity-5-multi-scene-support), please up vote, but for sure I'll tackle it no matter what.
Bye,
Jean
-
I voted on trello :)
Hopefully you can implement this. My scene manangement is pretty straight forward, Scene 1 -> Scene 2 -> Scene 3 and that's it ... but even like this I don't know how to do it without code :(
-
Hi,
Does the solution I mentionned above not working ( while I'll work on this) ?
Bye,
Jean
-
I didn't really understood the above solution. I don't know what "sub level loading" is.
Like I got the idea of a FSM in Scene 3 that activates when the Scene 3 has loaded... but I don't know how to make Scene 2 to stop changing the level.
But this is not 100% urgent. I can wait like 1 month.
-
Hey guys,
Fyi there is whole bunch of scene manager actions on the ecosystem
-
Hey Jean. I saw Trello ... is it done? :D
-
Hi,
It's pending release, it should be on the next PlayMaker Update :)
Bye,
Jean
-
Hell yea! Thanks Jean for doing this! <3 :-* :-* :-* :-* :-* :-* :-* :-*
-
Hello Jean!
Is there a way to get my hands on the new Scene actions? I'm looking on the EcoSystem but not sure how they are called.
-
Hi,
There are currently in beta, PlayMaker update will likely be out very soonn, but if you want you can apply for the beta and you'll get access to the the scenes actions. Pm me to apply to the beta.
Bye,
Jean
-
I know I'm late to this, but what is this action called? I've been using the load level action but I don't want the transition to happen immediately.
This action seemed great but where can I find it in the ecosystem?
Hi,
There are currently in beta, PlayMaker update will likely be out very soonn, but if you want you can apply for the beta and you'll get access to the the scenes actions. Pm me to apply to the beta.
Bye,
Jean
-
Hi.
@BlanketsWilson :
Search for 'Scene' ;)
-
@djaydino - Is it "Scene preload" in the ecosystem?
If so, I downloaded it and tried running the demo scenes and I'm getting this error
"Could Not Create Action: Load Manager: FSM: Unload: UnloadSceneAsynch (Maybe the script was removed?)"
https://flic.kr/p/27UKBxZ (https://flic.kr/p/27UKBxZ) - picture of error.
-
Hi.
They should be in the official action list :) (i think PM 1.8.7+)
-
Hi,
the action is named "LoadLevel" and you have a checkbox async to check if you want that level to be loaded asynchonously.
Bye,
Jean