MLStation
info
MLStation inherits from Component
MLStation component provides a mean to attach players to another object. The most common use for this is creating a seat. When attached to the station, the player loses its movement abilities, but still can move their head and hands. Using the Lua, the player controller inputs can be accessed and used to drive vehicles.
Members
Properties
Name | Description |
---|---|
MLStation .IsOccupied | True if there is a player attached to the station. (Read only) |
MLStation .Lock | Sets or gets the station lock. If the station is locked, the players cannot enter or exit the station. While locked, a player still can be attached or detached to the station using Lua script. |
MLStation .OnPlayerLeft | Event that triggers when a player leaves (detaches) the station. |
MLStation .OnPlayerSeated | Event that triggers when a player gets attached to the station. |
Methods
Name | Description |
---|---|
MLStation .GetInput() | Returns the current players controller inputs. Note that this function returns the controller inputs for the local player, so only the client which the current player is local can access the inputs. |
MLStation .GetPlayer() | Gets the MLPlayer object of current station occupant. Returns null if the station is empty. |
MLStation .RemovePlayer() | Removes (detaches) the current player from station if there is any. |
MLStation .SettlePlayer(player) | Attaches the given player to the station. Ignores if the station is occupied. |
Inherited Members
Inherited Properties
Name | Description |
---|---|
MLStation .gameObject | The game object this component is attached to. A component is always attached to a game object. |
MLStation .tag | The tag of this game object. |
MLStation .transform | The Transform attached to this GameObject. |
MLStation .hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
MLStation .name | The name of the object. |
Inherited Methods
Name | Description |
---|---|
MLStation .BroadcastMessage(methodName, parameter=nil) | Calls the method named methodName on every Lua Script in this game object or any of its children. |
MLStation .CompareTag(tag) | Is this game object tagged with tag ? |
MLStation .GetAllLuaScripts() | Returns an array of all Lua scripts that attached to the game object. |
MLStation .GetComponent(type) | Returns the component of Type type if the game object has one attached, nil if it doesn't. |
MLStation .GetComponentInChildren(t) | Returns the component of Type type in the GameObject or any of its children using depth first search. |
MLStation .GetComponentInParent(t) | Returns the component of Type type in the GameObject or any of its parents. |
MLStation .GetComponents(type) | Returns all components of Type type in the GameObject. |
MLStation .GetComponentsInChildren(t) | Returns all components of Type type in the GameObject or any of its children. |
MLStation .GetComponentsInParent(t) | Returns all components of Type type in the GameObject or any of its parents. |
MLStation .SendMessage(methodName, value=nil) | Calls the method named methodName on every Lua Script in this game object. |
MLStation .SendMessageUpwards(methodName, value=nil) | Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour. |
MLStation .TryGetComponent(type) | Gets the component of the specified type, if it exists. |
MLStation .GetInstanceID() | Returns the instance id of the object. |