Editor Question: Why is my script reloading constantly?

Godot Version

4.2stable


This is a screenshot of what occurs when I edit anything in scripts that I work with. I would usually not mind except happens with any edit and becomes somewhat annoying. Is there a setting to turn off or is something I need to do to avoid this?

did you edit the script code from godot’s editor?

Yes, I only use Godot’s built in editor. Any ideas on what could be causing this?

i read through some posts similar to this condition, did you also opened the player.gd somewhere else (like notepad) while working on the editor?

also try to copy and paste whole script code of player.gd to a new script example player_base.gd, then delete the player.gd. see if it is still happening on player_base.gd

Do you think version control through Github could cause this if its open at the same time?

yes, possibly, anything that tries to access the script from outside godot editor will cause it to be like that
but if you closed all any other apps and only have godot opened but still this reload thing keep popping up, then it really is a bug for unknown reason at your end

It is very strange. I have closed everything else and remade the player script, and it is still happening. Maybe it is a problem with the player object?

is this with the godot github plugin?

ye just try to make a new scriipt with exact same code of player, just remove the current “bugged” one, see if this issues still arise

It is not with the github plugin. I tried redoing the script and it still did not work. When I reload the script in the editor, it gives me this error printed around 300 times (which is crazy) “scene/gui/text_edit.cpp:5886 - Index p_gutter = -1 is out of bounds (gutters.size() = 4).” I do not know where to start with this.

did you try restart godot editor? like close it and reopen the engine then load the project?

Yes I have, it did not change anything.

Try to copy the project to a different directory and try to open it from the new location

Try the to do what the person above me said, If that didn’t help, Check the editor settings and set everything back to default, If this didn’t work, Consider opening Godot with the terminal, And check if it returns any error messages

Since my game was still in a somewhat early state, I was able to completely remove the old player object and remake it using nodes and copy and pasted scripts. This seemed to fix the problem. It must have been a glitch with the player scene itself. Thanks for everyone’s help!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.