Variables changing themselves

Godot Version

4.3

Question

I trigger my dialogue by having a script attached to an area 2d where if the player is in the area and a button is pressed then it plays the dialogue however the variable changes its self to true when you load it even though i declare it as false.


Any ideas what is happing. I am new to Godot but not game development/ coding. Thanks

You’re setting the variable to true for whatever body that touches this area, so even a scenary object can trigger this to true, probably you need to check if the body touching the is indeed your player.

3 Likes

thanks this has worked