Weird issue with object variables

I’m making a plinko/pachinko inspired mobile game where you can just kind of drop the balls and watch them trickle down the screen and there’s a bug where if you increase your bet whilst a ball is on screen you can increase the value of a ball before it hits the scoring zones so i tried to use an object variable o assign a bet to the ball that gets cashed in instead to fix it but for some reason this method works only once and after that the ball scores nothing at all until you restart the preview/game

[https://drive.google.com/file/d/1Voj6aOLVc_Hf0t22UFT3gi_nP5i1WOmG/view?usp=drive_link]
embed this in a blank html file and it should allow you to play the game
(upload://rssHfVL8Wr6TfDblPHbV4GZTsIP.png)


forgot to add the other image

I don’t see anything in the events that you posted that jumps out at me.

Thoughts. Because of the trigger once, only 1 ball can score in the score zone until all of the balls in a zone are deleted. Are the balls being deleted?

You could combine the scoring with the collision with the stopper. If multiple balls could collide then you would need for each instance.

Ball in collision with stopper
… For each ball
… … Ball is in collision with zone
… … Add bet * zone value
… … Delete ball

If you wanted to keep both events then you would need to filter out the balls once they collide with the zone. You could use another variable or other setting. If more than one could collide on the same frame then for each instance would be needed.

Ball collision with zone
variable HasCollied of ball is false

Set variable HasCollied of ball to true
Do other stuff…

Since you’re filtering out the balls. A trigger once wouldn’t be needed. It’s basically creating its own trigger once but at an object level.

doing this seems to have fixed it, thanks for the help! (again(you answered a previous post of mine ages ago))
Screenshot 2025-11-08 23.54.04

1 Like