+1 vote

I accidentally attached a script to a sprite instead of its parent Node2D object so I couldn't get access to the sprite node positions and such from that script. I know in the inspector that you can choose the script, set to none or such, but I ran into editor hell. In the filesystem I tried deleting the script, renaming it and reattaching it and lots of other stuff that didn't work out well. Even to the point that when I switched to the scripts tab I would get a new script created "GDScript" and a number. Eventually I deleted the entire tree and recreated it without errors to begin with. It was just a test project so that was no big deal at all. However if I had a large project that would be a very bad situation to say the least.

So, for a newbie, how do you properly rename or delete scripts?

in Engine by (13 points)

Did you try the Rename/Move and Delete options under the FileSystem tab?

I did try them again, I do not know what I did before but it all worked as you would expect when I tried it again. I am unable to reproduce the problem I had.

Yeah I think it's common to go through this script hell when first using Godot, I know I did. Those built-in scripts are not explained anywhere and seem to cause lots of issues. Maybe that's what happened to you, I don't know. Best not to rename things outside of Godot though, if that was the case.

See: This Video

I was able to reproduce the issue.

There's a bug in there somewhere so a permalink for this discussion is (which links to the GitHub issue): Here.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.