# Add the RenamedFrom attribute to a C# script To use nodes generated from a custom C# script in a project after you rename a member, class, struct, type, or enum, add the `[RenamedFrom]` attribute to the relevant API element in the script file. For more information on the `[RenamedFrom]` attribute, see [Refactor a C# script with Visual Scripting](vs-refactoring.md). To add the attribute to a C# script:
[!include[open-project-window](./snippets/vs-open-project-window.md)]
In the Project window, double-click the C# script file you want to refactor. Unity opens the file in the program you specified in your preferences, under External Script Editor.
For more information on script editors in Unity, see Integrated development environment (IDE) support in the Unity User Manual.
In your external editor, do the following:
Add the [RenamedFrom]
attribute above the definition of the part of the script you want to rename.
Add the element's old name as a string to the [RenamedFrom]
attribute, as its parameter. For example:
using UnityEngine;
using Unity.VisualScripting;
[RenamedFrom("Character")]
public class Player : MonoBehaviour
{
[RenamedFrom("InflictDamage")]
public void TakeDamage(int damage)
{
//...
}
}
[!include[save-script](./snippets/vs-save-script.md)]
[!include[return-unity](./snippets/vs-return-unity.md)]
[!include[regen-node-library](./snippets/vs-regen-node-library.md)]