- Home /
How to rename a script?
I have a script but I want to change its name. However
If I change it in Project tab (Unity) it gets a complete mess in my project.
The other way is to delete the script and create a new one, but it takes time and later I have to attach it again to every GO it is attached to...
Answer by HernandoNJ · May 01, 2020 at 10:31 PM
Open the script in Visual Studio
Select the script's name
Ctrl + R twice (Rename)
Check "Rename file" box
Change the script's name
Click on "apply"
The script's name will be changed not only in the script but also in its file in the computer. The name will change automatically when saving the script and returning to Unity.
This change will be applied to all the references in the editor too.
Great! This is the only solution I found so far for Unity 5 and Windows. Thanks a lot!
I dont' see or can't find the "Rename file - box". Any ideas? (osx)
@ngerbens I just did it like he says. There is indeed no "Rename file - box" to check, but it will do it anyway.
Your answer

Follow this Question
Related Questions
How would i make it transform player.position =target.position? 2 Answers
Point Counter Works Only Once! 1 Answer
how to allow the key to only open 1 door rather than all of them? 0 Answers
How do I make do I make a variable go back to its original value for a spell system 1 Answer
Its not playing the Audio? 2 Answers