Discuss Scratch

ArcticFox_GG
Scratcher
9 posts

Script only working half the time?

I'm currently making a trailer for a game where an overlay is meant to show up at a certain point. However, I've found that the overlay only shows up half the time and when you click the green flag a second time without editing the code the overlay doesn't show up. Does anyone know why this is happening?


Update: after a while I figured it out, the ‘room’ sprite was going to the front layer at the same time as the overlay, resulting in a 50-50 chance of each one being at the front. I changed ‘go to front layer’ to ‘go forward 1 layer’ and that fixed it. Thanks everyone who tried to help.

Last edited by ArcticFox_GG (April 12, 2022 02:21:48)

historical_supa
Scratcher
1000+ posts

Script only working half the time?

Please share your project.
BuzzedOut
Scratcher
500+ posts

Script only working half the time?

As historical said, we need to see the project or code to help. It’s impossible to see what’s wrong with it without this.
Kiska-7275
Scratcher
1000+ posts

Script only working half the time?

Provide the project ID, please
(The id is the part after scratch.mit.edu/projects/ and before /fullscreen/ or /editor/ (if you have these in your link))

Last edited by Kiska-7275 (April 11, 2022 12:19:52)

ArcticFox_GG
Scratcher
9 posts

Script only working half the time?

The project link is here: https://scratch.mit.edu/projects/673635121/ the first time you watch this it probably will work but if you watch it again the overlay won't show up and you just have this weird brightness effect.
ArcticFox_GG
Scratcher
9 posts

Script only working half the time?

New update: after some testing I have discovered that the overlay is appearing behind the ‘room’ sprite despite me adding ‘go to front layer’ multiple times.

Update: I fixed it it's all good

Last edited by ArcticFox_GG (April 12, 2022 02:18:13)

FriednFresh1234
Scratcher
1 post

Script only working half the time?

Im making this game where you shoot donuts, and the donuts are shootable, but the second time you play, it just doesn't work. I checked all the code and nothing was wrong. I think this is a bug, but if I am mistaken it could be my fault.
SpyCoderX
Scratcher
1000+ posts

Script only working half the time?

FriednFresh1234 wrote:

Im making this game where you shoot donuts, and the donuts are shootable, but the second time you play, it just doesn't work. I checked all the code and nothing was wrong. I think this is a bug, but if I am mistaken it could be my fault.
Welcome to the Scratch Forums!

If you have a coding question (which you do), you can make a new topic for it. (Or use this link)

Also, please don't reply to old, abandoned threads. This is known as necroposting and is considered spam.

Thanks!

Powered by DjangoBB