What does your “value” field start on? It also may depend on if anything else is changing your value field too.
If it starts on something non-zero and isn’t changed by anything else (e.g. nothing else does value=2; for example) then the above should run exactly once
And as shown in update I set it to zero and it still runs what is in the if loop.[quote=“KulestarUK, post:2, topic: 539751, username:KulestarUK”]
What does your “value” field start on? It also may depend on if anything else is changing your value field too.
If it starts on something non-zero and isn’t changed by anything else (e.g. nothing else does value=2; for example) then the above should run exactly once
[/quote]
It runs just once for me What type is your “value” variable? Also you could pop up your script in the inspector to see what value is whilst it plays (as you’re possibly setting it from somewhere else).
Alternatively you might be destroying and recreating the object that your script is attached to - that would cause it to act like its being reset.