A game object, such as the player, a system or an item. It stands in for the object in the game: call its methods as if it were local, with await.
await
A reference points at the object weakly. When the game deletes the object, or a save loads, calls on it fail with "that game object no longer exists".
const player = await api.GetPlayer(game.instance);const pos = await player?.GetWorldPosition(); Copy
const player = await api.GetPlayer(game.instance);const pos = await player?.GetWorldPosition();
Readonly
The reference's id.
The object's class, its native name, for example "PlayerPuppet".
"PlayerPuppet"
Calls a method by its full name, for overloads that share a name.
await obj.$call("SetHealth;Float", 100); Copy
await obj.$call("SetHealth;Float", 100);
Reads one of the object's properties.
const slots = await player.$get("quickSlotsManager"); Copy
const slots = await player.$get("quickSlotsManager");
Writes one of the object's properties, with the same type checks as arguments. A resource reference takes a depot path or its hash.
await mesh.$set("meshAppearance", "default");await mesh.$set("visualScale", { X: 2, Y: 2, Z: 2 }); Copy
await mesh.$set("meshAppearance", "default");await mesh.$set("visualScale", { X: 2, Y: 2, Z: 2 });
A game object, such as the player, a system or an item. It stands in for the object in the game: call its methods as if it were local, with
await.A reference points at the object weakly. When the game deletes the object, or a save loads, calls on it fail with "that game object no longer exists".
Example