I'm making a mechanic in my game where the player can shoot a bullet to change the size of a box to make it bigger. The part of shooting at the object and it changing in size is working, the problem is that everytime you shoot at the box it become larger and larger, and I want to scale up the object only one time. I've tried a lot of stuff to resolve, but I can't find how to solve it.
The images are respectively from the bullet code and the box code:
#How can I stop an object from being interacted with?
4 messages · Page 1 of 1 (latest)
Make a property in the box "var hitted = false"
In the bullet script check if the hitted property in the box is false, and only then apply the scale. After applying the scale, set hitted to true
Something like this:
body.scale *= 2
body.hitted = true```
I just seen your message now, and thank you so much, I tested and It is working. Thank you!
Cool!