Make a Sprite stop doing its behavoirs

So I’m making a game just for fun currently and I have a sprite that walks to a car, once it reaches the car I want the game to switch to a different “scene” by just turning stuff invisible and other things visible, however, the sprite will still do things like walk even when invisible. Another example, I was making a back button but when I don’t want the button there I would turn it invisible, but I realized if you clicked where that button would be, it will still act like it was there. I was wondering if there was a way to disable a sprite and then being able to re-enable it later perhaps?

-thanks, Lucas

The sprite.destroy() function will remove a sprite altogether. When you need it back you can simply recreate it in the same place. You could also move it way off the screen so it’s not possible to interact with it, but this could also slow things down.

1 Like

Would If-then statements help? If … then the sprite walks. When that isn’t true the sprite won’t walk. Without seeing the code, I’m not sure if this would help.