I'm having a very annoying problem with changing scenes

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By orangeproductions

So, when ever i change scenes with a button (ingame), if i keep the mouse in the same position as the last scene, the button still registers as clicked. Even if i move the mouse a few pixels to the side.

(Here’s the script, it’s pretty simple)

extends Control

func _on_PlayButton_pressed():
    get_tree().change_scene('res://Scenes/flowerpark.tscn')

I am not sure that I get your explanation. Does the flowerpark scene have a second button at the same location which is clicked right on start?

(I don’t think that should happen but in that case one way around this would be to set that (2nd) button to disabled and run a timer with autostart to enable the button again after i.e. a second.)

– This comment has been copied to an answer according to the next comment. –

wombatstampede | 2019-03-15 08:07

I did kind-of explain vaguely.
The flowerpark scene does not have a button in the same place, but i think that the previous scene’s objects still exists.
As for the solution - Yes, it did work, i actually never thought of that. I would just have to re-enable it when the title screen is back on. I guess - that this could be marked as answered.

orangeproductions | 2019-03-15 21:23

:bust_in_silhouette: Reply From: wombatstampede

I don’t think that should happen but in that case one way around this would be to set that (2nd) button to disabled and run a timer with autostart to enable the button again after i.e. a second.