# How can I get the name of a scriptable object via code

How can I get the name of a scriptable object, same way I would a game object gameObject.name?

I've tried:

object.name
scriptableObject.name
ScriptableObject.name
name
this.name

//String GetName()
WorldObjectData obj = ScriptableObject.CreateInstance<WorldObjectData>();
SerializedObject serializedObject = new SerializedObject(obj);
return serializedObject.FindProperty("m_name");


I can see that ScriptableObject extends Object, which has the .name attribute. But cant access it.

Presumably you started by trying the most obvious thing, object.name, the same way you would with a game object?
They both inherit from UnityEngine.Object which is where the .name field is defined.
• I see the issue now I think, Im using a field variable name, which hides Object.name – Majs Aug 10 '20 at 13:17