Visual Scripting API Reference
This page contains a reference of the entire visual scripting API available to you in The Mirror.
Entry Signals
These signals can be used as entry points for your script (the first run blocks that are executed). Some come from SpaceObject, some come from subnodes, and some are global signals. Global scripts may only use global signals. Object scripts may use all signals.
SpaceObject
Signals emitted when a player interacts with a SpaceObject.
On Player Interact
Emitted when a player interacts with a SpaceObject.
Output Name | Data Type |
---|---|
Player | Object |
Trigger
Signals emitted when physics trigger events happen, like bodies entering triggers.
On Player Interact
Emitted when a player interacts with a trigger.
Output Name | Data Type |
---|---|
Player | Object |
On Body Entered Trigger
Emitted when a physics body is of type Trigger and another body enters it.
Output Name | Data Type |
---|---|
Body | Object |
On Body Exited Trigger
Emitted when a physics body is of type Trigger and another body exits it.
Output Name | Data Type |
---|---|
Body | Object |
Animation
Signals emitted when an AnimationPlayer node finishes playing an animation.
On Animation Animation Finished
Emitted when an AnimationPlayer node finishes playing an animation. This signal requires an AnimationPlayer subnode.
Output Name | Data Type |
---|---|
Animation Name | String |
Audio
Signals emitted when an audio player node finishes playing its audio.
On Audio Finished
Emitted when an audio player node finishes playing an audio file. This signal requires an AudioStreamPlayer(3D) subnode.
Timer
Signals emitted when a Timer node finishes counting down.
On Timer Timeout
Emitted when a Timer node finishes counting down. This signal requires a Timer subnode. Note: The duration is an input that you can adjust in the inspector, it is not supplied by the signal.
Output Name | Data Type |
---|---|
Duration | float |
Player
Global signals emitted when events happen to players.
On Player Connected
Emitted when a player connects to the server. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Player | Object |
On Player Disconnected
Emitted when a player disconnects from the server. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Player | Object |
On Player Killed By Player
Emitted when a player is killed by another player. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Victim Player | Object |
Killer Player | Object |
Victim Team | String |
Killer Team | String |
Friendly Fire | bool |
On Player Spawned
Emitted when a player spawns. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Player | Object |
Variables
Global signals emitted when variables are changed.
On Global Variable Changed
Emitted when any global variable is changed. To avoid infinite loops, this is deferred until the end of the frame. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Variable Name | String |
Variable Value | Variant |
On Global Variable Tweened
Emitted when any global variable is tweened. To avoid infinite loops, this is deferred until the end of the frame. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Variable Name | String |
From Value | Variant |
To Value | Variant |
Duration | float |
On Object Variable Changed
Emitted when any object variable is changed. To avoid infinite loops, this is deferred until the end of the frame. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Object | Object |
Variable Name | String |
Variable Value | Variant |
On Object Variable Tweened
Emitted when any object variable is tweened. To avoid infinite loops, this is deferred until the end of the frame. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Object | Object |
Variable Name | String |
From Value | Variant |
To Value | Variant |
Duration | float |
Match
Global signals emitted when a match or round starts or ends.
On Match Start
Emitted when a match starts. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Freeze Time | float |
On Match End
Emitted when a match ends (but not when it's terminated). This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Winning Team Name | String |
On Round Start
Emitted when a round starts. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Freeze Time | float |
On Round End
Emitted when a round ends (but not when it's terminated). This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Winning Team Name | String |
On Team Score Changed
Emitted when a team's score changes. This signal will only emit for valid teams. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Team Name | String |
Team Score | int |
Global
Misc global signals not covered by other categories.
On Game Start
Emitted when the game starts after all SpaceObjects have loaded. This is a global signal, it can be used from any script.
On Process Every Frame
Emitted every frame. Please avoid using this signal if possible, as it can be very expensive. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Delta Time | float |
On Death
Emitted when a player dies. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Target Object | Object |
Event Origin | String |
On Server Revive
Emitted when a player is revived by the server. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Target Object | Object |
Event Origin | String |
On Health Changed
Emitted when a player's health changes. This is a global signal, it can be used from any script.
Output Name | Data Type |
---|---|
Target Object | Object |
New Health | float |
Old Health | float |
Event Origin | String |
OMI_seat
Signals emitted from a seat as defined by OMI_seat.
On OMI_seat Player Sit Here
Emitted when a player sits on a seat as defined by OMI_seat. This signal requires an OMI_seat subnode.
Output Name | Data Type |
---|---|
Player | Object |
On OMI_seat Player Unsit Here
Emitted when a player stops sitting on a seat as defined by OMI_seat. This signal requires an OMI_seat subnode.
Output Name | Data Type |
---|---|
Player | Object |
OMI_spawn_point
Signals emitted from a spawn point as defined by OMI_spawn_point.
On OMI_spawn_point Player Spawned Here
Emitted when a player spawns at a spawn point as defined by OMI_spawn_point. This signal requires an OMI_spawn_point subnode.
Output Name | Data Type |
---|---|
Player | Object |
Script Blocks
Regular script blocks. These allow you to perform actions (run blocks) or gather information (data blocks).
Misc
These blocks are very important, and so are top-level in the script block creation dialog, not tucked away in a category.
Print In Chat (Say/Shout/Global)
Prints a Message to the chat. If ran on a script attached to an object, it will make that object "talk". If the Range is 0 or less, it will be global. If the range is less than 2, it will be a whisper. If the range is less than 40, it will be a say. If the range is 40 or greater, it will be a shout.
Input Name | Data Type | Default Value |
---|---|---|
Message | Variant | "" |
Range | float | 20.0 |
Print Notify
Prints a Message to the notification area. The Notify Status can be Info, Success, Warning, or Error.
Input Name | Data Type | Default Value |
---|---|---|
Title | String | "Script Notification" |
Message | Variant | "" |
Notify Status | String | "Info" |
Emit Signal
Emits a custom user-defined signal on an object. The Signal Name must be a signal with an entry block already defined elsewhere in your Space. If the Object is null, the signal will emit on the object the script is attached to.
Input Name | Data Type | Default Value |
---|---|---|
Signal Name | String | "" |
Object | Object | null |
Flow
Flow blocks control the flow of execution in your script. They are used to run code in a specific order, or to run code when a condition is met.