Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi I want to know if there are a script that can reload a scene like the script ccbSwitchToScene |
||||
|
There is an built-in action called "Restart a scene" under "Cameras and scenes". You can pass parameter of type action to your behavior. Header: <behavior jsname="behavior_Test" description="Test"> You can then invoke this action from the code: ccbInvokeAction(this.actionToCall, this) Finally, as you put the behavior/action in-game, add "restart a scene" action to actionToCall parameter. If you're using js file that you put along the .exe there is no way to do that. |
||||
|
Thanks for your help. But I want to create action that allow to go to the last active scene. For that before exit the last scene I save a variable named last scene and load it like that. var scene = ccbGetCopperCubeVariable(this.lastscene) To avoid many repetition of if...if else....else |
||||
|
Well, you can reset all scenes every time, and use a single action for that, if it works for you. Or you can also use switch statement instead of multiple if else for better readability. |
||||
|
Okay thanks |
|