SplitScript reference / UnityGameObject / name

UnityGameObject.name

Method

UnityGameObject.name() -> String!

Reads this GameObject's current name.

The name is decoded from Unity's native GameObject storage on every call, so a stale or unreadable live handle returns an error.

Effects: reads process memory, requires an attached process

Runtime behavior: available while a process is attached, except in onDetach; synchronous

Examples

Inspect a resolved object's name

whileAttached {
    let scene = unity.scenes.active() else return
    let player = scene.find("Player") else return
    print(player.name() else "Unknown")
}