Item
Readonly
nameThe name of the SubNode object.
It is the same as the subNodeName
specified in ClusterScript.subNode.
let subNode = $.subNode("MySubNode");
$.log(subNode.name); // => MySubNode
Obtains the Enabled state of the SubNode
.
If you call this immediately after calling setEnabled, please be aware it will return the SubNode
's current Enabled state, not the state passed to setEnabled.
If the value cannot be obtained, this method will return undefined
.
Obtains the current position.
If you call this immediately after calling setPosition, please be aware it will return the SubNode
's current position, not the value passed to setPosition.
If the value cannot be obtained, this method will return null
.
Current position (Global coordinates)
Obtains the current rotation.
If you call this immediately after calling setRotation, please be aware it will return the SubNode
's current rotation, not the value passed to setRotation.
If the value cannot be obtained, this method will return null
.
Current rotation (Global coordinates)
Obtains the current position of the SubNode
.
If you call this immediately after calling setPosition, please be aware it will return the SubNode
's current position, not the value passed to setPosition.
If the value cannot be obtained, this method will return undefined
.
Current position (local coordinates of the item)
Obtains the current rotation of the SubNode
.
If you call this immediately after calling setRotation, please be aware it will return the SubNode
's current rotation, not the value passed to setRotation.
If the value cannot be obtained, this method will return undefined
.
Current rotation (local coordinates of the item)
Obtains whether the SubNode
is treated as Enabled in the space.
A SubNode
is treated as Enabled in the space only when the SubNode
, and all of its parents, are Enabled.
If you call this immediately after calling setEnabled, please be aware it will return the SubNode
's current Enabled state, not the state passed to setEnabled.
If the value cannot be obtained, this method will return undefined
.
Beta
Gets the handle of the Unity component attached to this object by type name. The available type names are defined in UnityComponent.
If the object has multiple components, returns first component.
This API is only available for worlds uploaded from the Creator Kit. This API is not available from Craft Items.
The component specified by type name, or null
if not found
Modifies the Enabled state of the SubNode
.
A disabled SubNode
and all of its children will be treated as disabled in the space. It will not be displayed, and will be excluded from collision detection.
As the Enabled state is synced across the network, please be aware it may not be reflected immediately.
true
if Enabled
Specify a rotation to rotate the SubNode
to.
As the rotations are interpolated and synced across the network, please be aware they may not be reflected immediately.
Target rotation (local coordinates of the item)
Specify a text string for the SubNode
's text display.
Line breaks can be used by entering \n
.
The string must be 1 KB or less in size.
If the string exceeds 1 KB, this method will fail with a ClusterScriptError (requestSizeLimitExceeded
) error.
If the SubNode
does not have a TextView
attached, nothing will happen.
For details on TextView, refer to the documentation.
Specify the horizontal text alignment (if the text contains line breaks) of the SubNode
's text display.
If the SubNode
does not have a TextView
attached, nothing will happen.
For details on TextView, refer to the documentation.
subNode.setTextAlignment(TextAlignment.Left);
Specify the anchor position of the SubNode
's text display.
eg. When set to UpperLeft
, the upper left corner of the text display will match the SubNode
's position.
If the SubNode
does not have a TextView
attached, nothing will happen.
For details on TextView, refer to the documentation.
subNode.setTextAnchor(TextAnchor.UpperLeft);
Specify the font color of the SubNode
's text display.
Each of the RGBA values can be a number between 0 and 1. The color space is sRGB (Gamma).
If the SubNode
does not have a TextView
attached, nothing will happen.
For details on TextView, refer to the documentation.
Red value
Green value
Blue value
Alpha value (will be transparent when 0)
Specify the font size for the SubNode
's text display.
size
can be a number between 0 and 5. Values outside of this range will be clamped to the nearest valid value.
The final display size of the text depends on both the size
value set here, and the global scale of the SubNode
.
When the global scale of the SubNode
is 1 and size
is set to 1, the x-height of the text will be approximately 1 meter tall.
If the SubNode
does not have a TextView
attached, nothing will happen.
For details on TextView, refer to the documentation.
Generated using TypeDoc
A handle to manipulate child objects of this item.