Skip to content

Alias

The Alias system is a reliable way to reference game objects in the scene using a unique ID.

Inspired by Main Camera and Player

If you are familiar with Game Creator you'll have likely used the "Player" option of a dropdown menu when choosing a game object.

The Alias system works very similar but instead of hard-coding what the Player or the Main Camera is, it lets you choose a unique name that can be used to reference that game object, anywhere on the scene.

The Alias component

To give a game object a unique id simply add the Alias component to it. You can choose to automatically generate a unique ID when the game starts or give it an ID value yourself.

Alias component

Using Alias

To get the game object referenced by an ID you can choose the new Alias option from the dropdown menu when picking a game object. This will let you choose a text that represents the ID.

Null References

Note that if the Alias component with that ID does not exist, it will not throw an error and will simply return a null object.

The Alias system can also be used to check if a specific game object exists in the scene.

You can also get the string value of an ID from an Alias component. Simply choose the Alias ID option from a string-type property.

Changing an ID

You can also change the ID of an Alias component at runtime. Use the Change Alias ID instruction, which references a game object and requires a text input as the new ID of the component.

No saving

Note that changing the ID of an Alias does not save the new value when using the Save Game instruction.