Any idea why this is crashing the game?
I don’t really understand how the “while these conditions are true” event work
Any idea why this is crashing the game?
I don’t really understand how the “while these conditions are true” event work
While events keep looping and processing the actions until the condition is no longer true. They do not give up processing to the other events while the conditions are true.
In your event, because there is no action to change Scorecounting to false, the condition is always true, the while event loops indefinitely and the program appears to crash/never start.
This makes sense.
Sorry btw, I forgot to include the event that changes the variable to false
The change to false should happen 1-5 seconds once the scene starts, so I’m not sure why it crashes. (Actually the previewer doesn’t event start if you start the preview from this scene)
While events stop other events outside the while event from processing at all.
The while event stops all other events from proceeding and even stops the frame proceeding to the next event, until the while conditions are false.
That other score event will never process as it exists outside the while event.
I don’t think you even needed to use the “if the condition is true” algorithm. You can just input
If Variable is true-trigger once
Wait x seconds-Play sound
Can you post a screen shot of the “while” event and all it’s subevents?
This was the only event that I had in it.
@Silver-Streak @MrMen
Sorry, I had no idea that the while event stops all the other events of the game until its conditions are false. My fault for not checking the website first…
Still not really sure why it freezes the game. Shouldn’t it just keep repeating the sound and maybe crash the preview once I click somewhere else?
Also, just to answer @Phoenix I tried to do this without the while event, I also tried it by removing the trigger once button, but the sound won’t repeat.
I try to make a score counter effect, you know, like when you score big and the game keeps going repeating the point sound till all of the score is displayed?