Hello,
I’m trying to create a script that offers the possibility to play with scene names conditions. Let’s say there’s 3 scenes called A, B and C. The last one ‘C’ has 2 timelines called a and b which are played simultaneously on the main timeline. The idea is that if I come from the scene B and go to the C, only the timeline b should be played.
To get you a better picture, it would be like creating a playbook with multiple choices on every scenes.
As I’m beginner in Javascript and Hype, you must excuse me if this question is trivial. Nonetheless I found no comparable questions in your forums.
Thank you in advance for your answer.
Cheers, Quentin
it’s some efford, but you can work with custom behaviours that are triggered on any event.
That’s the approach of hype to built some logic without scripting.
Can you explain how this fits with his needs for me.
You have only one scene, so I do not see how 4 scenes, which I assume any of them could be opened in any order, how it knows what timeline to start. Might be just me, and of course perhaps Custom Behaviours are simpler, but I cannot see it.
Okay, I am honestly not being funny, but I do not understand what you are doing. Based on the OP, he wants to play a timeline based on the scene previous. So in your example, the idea is, when the user presses the button which takes him to a new scene, it then fires a timeline?
So if the user is on Scene 4, and clicks to visit Scene 2, how will the button know to play the timeline Scene 2, and if the user is on Scene 4 and wants to visit Scene 3, it would need to be a different button, unless he uses the Next / Previous option.
I have never used Custom Behaviours, probably because I have never needed them, but i do not understand the need for them in this instance, hence my questions. I am trying to learn the reason for them
So in your example, the idea is, when the user presses the button which takes him to a new scene, it then fires a timeline?
That's it
So if the user is on Scene 4, and clicks to visit Scene 2, how will the button know to play the timeline Scene 2
It will because you tell it to do so. Button on scene 4 has two actions : jump to scene 2 + play timeline
and if the user is on Scene 4 and wants to visit Scene 3, it would need to be a different button, unless he uses the Next / Previous option.
Yes. Going to scene 2 needs a button and going to scene 3 needs another one. The same button can't lead to different scenes (unless it is a next/previous button, which my example doesn't involve)
Custom behaviors is here needed because it's the only way from a scene to trigger a timeline in another scene.
Thanks for the exemple. I managed to do one myself using your advice but yours is more detailed.
What’s the purpose of the script SetSceneName ? Apparently, it’s empty.
Is there a way to create a button leading to last visited scene according to visit history ?