I tried the restart scene block today and everything reset except some code that was inside a forever loop. Is there away around this or do we need to avoid restart scene if the code requires a forever loop? Thanks ! Here is a link to the space
Copy the same scene first, Add an events “When …is clicked” to start new secne.
Hi @MBridges,
Thanks for pointing out this issue! We’ll fix the behavior of that block to properly restart the scene with our next release
Thank you for the suggestion. I’d prefer just one scene and think I’ve come up with a workaround - will post below.
Thanks, @Stefan! I found a workaround using a boolean variable. I’ve updated the code.
I appreciate the team will address this in the next release! The only reason I want this loop to stop is because it’s been triggered by a “when clicked”. Without such an event, I imagine one would want the forever loop to execute. (For instance, a Parkour scene where moving platforms start at the beginning of the scene.)
@Stefan, I just added a play sound block inside of the “when T-rex clicked” loop. It plays just fine but since it’s longer (20 seconds) it continues to play after reset has been clicked. I added a stop all sounds block at the end so it’s fine but thought I’d mention it in case you’d prefer to have the reset block include this function thereby eliminating the need for the additional stop sounds block.
Hi @MBridges,
I’m glad you found a solution to your particular issue.
The current “restart” CoBlock behavior is certainly not intended, so we’re fixing it to work just like you imagine it would
Chances are you found or will find out that physics also don’t reset properly but I figured I’d mention it just in case. I had to add a “remove physics” block work properly.
Hi,
I want to make a cospace in which when the camera collides with the laser, the scene restarts, but I have no idea on how to use the collision block. Anyone knows how to do this?
Hi 5d01,
Here is an example cospace with two uses of the “when (OBJECT) collides with (OBEJCT)” statement. It includes one that restarts the scene. You can check out the code by remixing the project. I have also pasted the code below. Please let me know if you have more questions!