MeshAction (Asset): Difference between revisions

From FetishQuest Wiki
Jump to navigation Jump to search
JasX (talk | contribs)
Created page with "Mesh actions are actions that can be run immediately (such as adding tweens to lights), or on interact. {| class="wikitable" |+ !Field !Type !Description |- |Type |String |Type of action. |- |Data |Object |A JSON object that describes your action. See below. |- |Conditions |Condition |Conditions needed for a task to run. For actions tied to onRefresh, these are checked when you enter the room with the mesh, or a refresh Game Action (Asset)|Game Ac..."
 
JasX (talk | contribs)
No edit summary
 
Line 78: Line 78:
|}
|}
Example: <code>{"prim":-1, "targ":"position", "from":{"x":0}, "to":{"x":100}, "e":"Sinusoidal.InOut", "d":1000, "l":-1, "y":true}</code> Moves the root prim back and forth infinitely on the X axis.
Example: <code>{"prim":-1, "targ":"position", "from":{"x":0}, "to":{"x":100}, "e":"Sinusoidal.InOut", "d":1000, "l":-1, "y":true}</code> Moves the root prim back and forth infinitely on the X axis.
{| class="wikitable"
|+Visibility
!Field
!Type
!Default
!Description
|-
|prim
|int
| -1
|Selects which prim should be hidden. -2 hides the full linkset.
|}
{| class="wikitable"
{| class="wikitable"
|+PlayAnim
|+PlayAnim

Latest revision as of 11:22, 28 May 2025

Mesh actions are actions that can be run immediately (such as adding tweens to lights), or on interact.

Field Type Description
Type String Type of action.
Data Object A JSON object that describes your action. See below.
Conditions Condition Conditions needed for a task to run. For actions tied to onRefresh, these are checked when you enter the room with the mesh, or a refresh Game Action is triggered. For interactions, it's raised when the player clicks the item (requires a game action set on it).

Data Field

Tween
Field Type Default Description
prim int -1 The prim to run the tween on. -1 targets the root prim, and -2 targets the entire linkset.
targ str Target object you wish to transform. Such as "position" to translate the object. This is relative to the prim (usually a THREE.Mesh). See the THREE.js mesh docs for more info.
from obj The start parameters to tween the object from. Such as {"x":0}
to obj The end parameters to tween the object to. Such as {"x":100}
e string Linear.None Tween.js easing type.
d int Duration of the tween in milliseconds.
l int 0 Sets nr times the animation should loop. Use -1 for infinity.
y bool false Sets if the loop style should be yoyo.
de int 0 Pre-delay before starting, milliseconds.
rd int 0 Delay between loops, milliseconds.

Example: {"prim":-1, "targ":"position", "from":{"x":0}, "to":{"x":100}, "e":"Sinusoidal.InOut", "d":1000, "l":-1, "y":true} Moves the root prim back and forth infinitely on the X axis.

PlayAnim
Field Type Default Description
anim string Animation name

Note: The following animations are automatically handled for you, and you don't need to create meshActions to play them: idle, idleOpen, open

PlaySound
Field Type Default Description
url str URL to the sound you want to play. Must be an OGG file.
volume float 1.0 Volume of the sound to play.