GetSingleton
Retrieves a singleton entity by its class name.
TIP
Class names can be found in the Entities section in the debug menu [F11]
IMPORTANT
Used for entities that only have one instance in the game.
GetSingleton<T = Entity>(type: string)T | null
typestring - The class name of the entity to retrieve.
Returned:
- T | null - The entity that matches the provided class name. If no entity is found, null is returned.