Interactable
A userdata object representing an interactable shape in the game.
Values:
Functions:
Operations:
active boolean
Get:
Returns the logic output signal of an interactable. Signal is a boolean, on or off.
Set:
Server only
Sets the logic output signal of an interactable. Signal is a boolean, on or off.
Get:
Returns the Body an interactable's Shape is part of.
id integer
Get:
Returns the id of an interactable.
power number
Get:
Returns the power output signal of an interactable. Signal is a number between -1 to 1, where 1 is forward and -1 backward.
Set:
Server only
Sets the power output signal of an interactable. Signal is a number between -1 to 1, where 1 is forward and -1 backward.
publicData table
Get:
Server only
Returns (server) public data from a interactable.
Set:
Server only
Sets (server) public data on a interactable.
Get:
Returns the Shape of an interactable.
type string
Get:
Returns the interactable type of an interactable.
addContainer(interactable, index, size, stackSize=MaxSize)
Server only
Creates and stores a container in the given index inside the controller
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | index | The index of the container [0-15]. |
integer | size | The number of slots in the container. |
integer | stackSize=MaxSize | The stack size. Defaults to maximum possible stack size(65535). |
Returns:
Type | Description |
Container | The created container. |
connect(parent, child)
Server only
Connects two interactables. Similar to using the Connect Tool.
Parameters:
Returns:
Type | Description |
boolean | Returns true if the connection attempt was successful. |
connectToJoint(parent, child)
Server only
Connects interactable with joint.
Parameters:
Type | Name | Description |
Interactable | parent | The sender of a connection. |
Joint | child | The receiver of a connection. |
disconnect(parent, child)
Server only
Disconnects two interactables. Similar to using the Connect Tool.
Parameters:
Returns:
Type | Description |
boolean | Returns true if the disconnect attempt was successful. |
getAnimDuration(interactable, name)
Client only
Returns animation duration in seconds.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
string | name | The name of the animation. |
Returns:
Type | Description |
number | The animation duration. |
getBearings(interactable)
Returns a table of bearings that an interactable is connected to.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
table | A table of the connected bearings {Joint, ..}. |
getBody(interactable)
Returns the Body an interactable's Shape is part of.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
Body | The body an interactable's shape is part of. |
getChildren(interactable, flags)
Returns a table of child interactables that an interactable is connected to. The children listen to the interactable's output.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | flags | Connection type flags filter. (defaults to all types except for sm.interactable.connectionType.bearing (for backwards compability)) |
Returns:
getColorHighlight(interactable)
Returns the connection-point highlight color of an interactable. The point is shown when using the Connect Tool.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
Color | The connection-point highlight color. |
getColorNormal(interactable)
Returns the connection-point color of an interactable. The point is shown when using the Connect Tool.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
Color | The connection-point color. |
getConnectionInputType(interactable)
Returns the input connection type.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
integer | connection type The input connection type. |
getConnectionOutputType(interactable)
Returns the output connection type.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
integer | connection type The output connection type. |
getContainer(interactable, index=0)
Returns the container stored in the given index inside the controller
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | index=0 | The index of the container (default: 0). |
Returns:
getGlowMultiplier(interactable)
Client only
Gets the glow multiplier.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
number | The glow multiplier (0.0 - 1.0). |
getId(interactable)
Returns the id of an interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
integer | The interactable's id. |
getJoints(interactable)
Returns a table of all joints that an interactable is connected to. Joints include bearings and pistons.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
table | A table of the connected joints {Joint, ..}. |
getLocalBonePosition(interactable, name)
Return the position of the bone
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
string | name | The bone name. |
Returns:
Type | Description |
Vec3 | The position. |
getMaxChildCount(interactable)
Returns the maximum number of allowed child connections of an interactable – the number of outgoing connections.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
integer | The max child connection count. |
getMaxParentCount(interactable)
Returns the maximum number of allowed parent connections of an interactable – the number of incoming connections.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
integer | The max parent connection count. |
getParents(interactable, flags)
Returns a table of parent interactables that are connected to an interactable. The parents act as the interactable's input.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | flags | Connection type flags filter. (default to all types) |
Returns:
getPistons(interactable)
Returns a table of pistons that an interactable is connected to.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
table | A table of the connected pistons {Joint, ..}. |
getPoseWeight(interactable, index)
Client only
Returns the pose weight of the pose in the given index.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | index | The index. |
Returns:
Type | Description |
number | The pose weight. |
getPower(interactable)
Returns the power output signal of an interactable. Signal is a number between -1 to 1, where 1 is forward and -1 backward.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
number | The power output signal. |
getPublicData(interactable)
Server only
Returns (server) public data from a interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
table | The public data. |
getSeatCharacter(interactable)
Returns the Character that is seated in the Interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
getSeatInteractables(interactable)
Retrieves the list of Interactable connected to the seat.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
getShape(interactable)
Returns the Shape of an interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
Shape | The shape which hosts the interactable. |
getSingleParent(interactable)
Returns the parent Interactable that is connected to an interactable. The parent act as the interactable's input.
Warning:
This method is not allowed for an interactable that allows more than one parent connection.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
Interactable | The connected parent interactable. |
getSteeringAngle(interactable)
Returns the steering angle of an steering interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
number | The steering angle |
getSteeringJointLeftAngleLimit(interactable, joint)
Returns the left angle limit of a Joint connected to a steering Interactable.
Parameters:
Returns:
Type | Description |
number | The left angle limit. |
getSteeringJointLeftAngleSpeed(interactable, joint)
Returns the left angle speed of a Joint connected to a steering Interactable.
Parameters:
Returns:
Type | Description |
number | The left angle speed. |
getSteeringJointRightAngleLimit(interactable, joint)
Returns the right angle limit of a Joint connected to a steering Interactable.
Parameters:
Returns:
Type | Description |
number | The right angle limit. |
getSteeringJointRightAngleSpeed(interactable, joint)
Returns the right angle speed of a Joint connected to a steering Interactable.
Parameters:
Returns:
Type | Description |
number | The right angle speed. |
getSteeringJointSettings(interactable, joint)
Returns the settings of a Joint connected to a steering Interactable.
Parameters:
Returns:
Type | Description |
number,number,number,number,boolean | The left angle speed; right angle speed; left angle limit; right angle limit; true if the joint is unlocked. |
getSteeringJointUnlocked(interactable, joint)
Returns the unlocked state of a Joint connected to a steering Interactable.
Parameters:
Returns:
Type | Description |
boolean | True if the joint is unlocked |
getSteeringPower(interactable)
Returns the Character that is locking the controller.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
getType(interactable)
Returns the interactable type of an interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
getUvFrameIndex(interactable)
Client only
Returns the index of the current UV animation frame
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
integer | The uv frame. |
getWorldBonePosition(interactable, name)
Return the position of the bone
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
string | name | The bone name. |
Returns:
Type | Description |
Vec3 | The position. |
hasAnim(interactable, name)
Client only
Checks if an animation exists.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
string | name | The name of the animation. |
Returns:
Type | Description |
boolean | True if exists, false otherwise. |
hasOutputType(interactable, flags)
Returns true if the Interactable has the output type.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | flags | The output type. |
Returns:
Type | Description |
boolean | Has the output type. |
hasSeat(interactable)
Returns true if Interactable has a seat component.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
boolean | The result. |
hasSteering(interactable)
Returns true if Interactable has a steering component.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
boolean | The result. |
isActive(interactable)
Returns the logic output signal of an interactable. Signal is a boolean, on or off.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Returns:
Type | Description |
boolean | The logic output signal. |
pressSeatInteractable(interactable, index)
Triggers a press interaction on a Interactable connected to the seat.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | index | The index of the interactable to press. |
Returns:
Type | Description |
boolean | True if successful. |
releaseSeatInteractable(interactable, index)
Triggers a release interaction on a Interactable connected to the seat.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | index | The index of the interactable to release. |
Returns:
Type | Description |
boolean | True if successful. |
removeContainer(interactable, index)
Server only
Removes the container stored in the given index inside the controller
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | index | The index of the container. |
setActive(interactable, signal)
Server only
Sets the logic output signal of an interactable. Signal is a boolean, on or off.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
boolean | signal | The logic output signal. |
setAnimEnabled(interactable, name, enabled)
Client only
Sets whether the animation with the given name should be applied to the mesh. True enables the animation and false disables it.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
string | name | The name of the animation. |
boolean | enabled | The boolean enable state. |
setAnimProgress(interactable, name, progress)
Client only
Sets the progress on the animation with the given name.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
string | name | The name of the animation. |
number | progress | The animation's progress between 0 and 1. |
setGlowMultiplier(interactable, value)
Client only
Sets a value to multiply the glow from asg texture with.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
number | value | The glow multiplier (0.0 - 1.0). |
setGyroDirection(interactable, direction)
Client only
Set the direction of the gyro
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Vec3 | direction | The gyro direction. |
setParams(interactable, data)
Sets param data for a script interactable
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable, needs to be of script type. |
any | data | The param data. |
setPoseWeight(interactable, index, value)
Client only
Set the pose weight of the pose in the given index.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | index | The index. |
number | value | The pose weight. |
setPower(interactable, signal)
Server only
Sets the power output signal of an interactable. Signal is a number between -1 to 1, where 1 is forward and -1 backward.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
number | signal | The power output signal. |
setPublicData(interactable, data)
Server only
Sets (server) public data on a interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
table | data | The public data. |
setSeatCharacter(interactable, character)
Requests to seat a Character in the Interactable.
Parameters:
setSteeringFlag(interactable, steering)
Set the steering flag for a steering interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | steering | flags The steering flags. |
setSteeringJointLeftAngleLimit(interactable, joint, value)
Client only
Sets the left angle limit settings of a Joint connected to a steering Interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Joint | joint | The joint. |
number | value | The left angle limit. |
setSteeringJointLeftAngleSpeed(interactable, joint, value)
Client only
Sets the left angle speed settings of a Joint connected to a steering Interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Joint | joint | The joint. |
number | value | The left angle speed. |
setSteeringJointRightAngleLimit(interactable, joint, value)
Client only
Sets the right angle limit settings of a Joint connected to a steering Interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Joint | joint | The joint. |
number | value | The right angle limit. |
setSteeringJointRightAngleSpeed(interactable, joint, value)
Client only
Sets the right angle speed settings of a Joint connected to a steering Interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Joint | joint | The joint. |
number | value | The right angle speed. |
setSteeringJointSettings(interactable, joint, left, right, left, right, unlocked)
Client only
Sets the settings of a Joint connected to a steering Interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Joint | joint | The joint. |
number | left | angle speed The left angle speed. |
number | right | angle speed The right angle speed. |
number | left | angle limit The left angle limit. |
number | right | angle limit The right angle limit. |
boolean | unlocked | Returns true if the joint is unlocked. |
setSteeringJointUnlocked(interactable, joint, value)
Client only
Sets unlocked settings of a Joint connected to a steering Interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
Joint | joint | The joint. |
boolean | value | true if joint is unlocked |
setSubMeshVisible(interactable, name, visible)
Client only
Set the visibility of a submesh
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
string | name | Name of the submesh. |
boolean | visible | True if the submesh should be visible. |
setUvFrameIndex(interactable, index)
Client only
Sets the UV animation frame with the given index.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | index | The index. |
unsetSteeringFlag(interactable, steering)
Unset the steering flag for a steering interactable.
Parameters:
Type | Name | Description |
Interactable | interactable | The interactable. |
integer | steering | flags The steering flags. |