public class GameObjectWrapper : UnityObjectWrapper

Wrapper around the Unity GameObject class. Every component in the world has a parent GameObject which it is tied to.


public GameObjectWrapper GetChildByName(string name)

(Client) Get the child of an object by its name.

Arguments

Returns: (GameObject) The child game object.


public GameObjectWrapper GetChildByIndex(int index)

(Client) Get the child of an object by its index.

Arguments

Returns: (GameObject) The child game object.


public bool IsActive()

(Client) Is this game object active?

Returns: (bool) Whether this game object is considered to be active.


public void SetActive(bool active)

(Client) Set whether this game object is active.

Arguments


public bool IsObjectNetworked()

(Client) Is this game object networked?

Returns: (bool) Whether this game object is networked.


public uint GetNetworkID()

(Client) Get the network ID of this game object.

Returns: (uint) The network ID of this object if it's networked, the max value of uint if it isn't.


public TransformWrapper GetTransform()

(Client) Get the transform of this game object.

Returns: (Transform) The transform.


public string GetTag()

(Client) Gets the tag of this object.

Returns: (string) The tag.


public void SetTag(string tag)

(Client) Sets the tag of this object.

Arguments


public bool CompareTag(string tag)

(Client) Compares the tag of this object to another one.

Arguments

Returns: (bool) Whether they're the same.


public void EnableCollision(bool enabled)

(Client) Enables collision for this game object (on the condition it contains a renderer).

Arguments


public void IgnoreCollisionFrom(GameObjectWrapper gameObject, bool ignore)

(Client) Makes this game object ignore collisions with another game object.

Arguments


public void MakeUsable(string useMessage, bool disableAfterUse)

(Client) Turns this game object useable.

Every time a client uses it, it will send the "EntityUsed" payload.

Arguments


public void SetUsageAllowed(bool allowed)

(Client) Sets whether the usage of this object is allowed.

Arguments


public void MakePlayerBarrier()

(Client) Make the collision of this game object only interact with players, allowing other collisions (like projectiles) to pass through.


public void IgnorePlayersAndProjectiles()

(Client) Make the collision of this game object only interact with raycasts, ignoring players and projectiles.


public void MakeProp(LuaVector3 positionConstraints, LuaVector3 rotationConstraints, float weightMultiplier = 1f, float sleepingVelocity = 0.5f)

(Client) Turns on physics for this game object. Props are not synced.

Arguments


public void ListenToCollisions(bool addPlayerTrigger = false, float boundsMultiplier = 1.025f)

(Client) Makes this object listen for collisions.

When a collision is detected with this object, it will send the "ObjectCollision" payload.

Arguments


public RectTransformWrapper GetRectTransform()

(Client) Get the rect transform of this object. This is only valid for UI elements.

Returns: (RectTransform) The rect transform.


public MeshRendererWrapper GetMeshRenderer()

(Client) Get the Mesh Renderer of this game object.

Returns: (MeshRenderer) The mesh renderer.