Plays, loops, or stops an audiosource. Any AudioSources with the same tag as the target Audio Source will automatically be stoped.
Defined in Fungus.Commands.ControlAudio
Property | Type | Description
--- | --- | ---
Control | Fungus.Commands.ControlAudioType | What to do to audio
@ -15,6 +17,8 @@ Wait Until Finished | System.Boolean | Wait until this command has finished befo
## Play Music
Plays looping game music. If any game music is already playing, it is stopped. Game music will continue playing across scene loads.
Defined in Fungus.Commands.PlayMusic
Property | Type | Description
--- | --- | ---
Music Clip | UnityEngine.AudioClip | Music sound clip to play
@ -25,6 +29,8 @@ Fade Duration | System.Single | Length of time to fade out previous playing musi
## Play Sound
Plays a once-off sound effect. Multiple sound effects can be played at the same time.
Defined in Fungus.Commands.PlaySound
Property | Type | Description
--- | --- | ---
Sound Clip | UnityEngine.AudioClip | Sound effect clip to play
@ -34,6 +40,8 @@ Wait Until Finished | System.Boolean | Wait until the sound has finished playing
## Play Usfxr Sound
Plays a usfxr synth sound. Use the usfxr editor [Tools > Fungus > Utilities > Generate usfxr Sound Effects] to create the SettingsString. Set a ParentTransform if using positional sound. See https://github.com/zeh/usfxr for more information about usfxr.
Defined in Fungus.Commands.PlayUsfxrSound
Property | Type | Description
--- | --- | ---
Parent Transform | UnityEngine.Transform | Transform to use for positional audio
@ -43,6 +51,8 @@ Wait Duration | System.Single | Time to wait before executing the next command
## Set Audio Pitch
Sets the global pitch level for audio played with Play Music and Play Sound commands.
Defined in Fungus.Commands.SetAudioPitch
Property | Type | Description
--- | --- | ---
Pitch | System.Single | Global pitch level for audio played using the Play Music and Play Sound commands
@ -52,6 +62,8 @@ Wait Until Finished | System.Boolean | Wait until the pitch change has finished
## Set Audio Volume
Sets the global volume level for audio played with Play Music and Play Sound commands.
Defined in Fungus.Commands.SetAudioVolume
Property | Type | Description
--- | --- | ---
Volume | System.Single | Global volume level for audio played using Play Music and Play Sound
@ -60,3 +72,5 @@ Wait Until Finished | System.Boolean | Wait until the volume fade has completed
Draws a fullscreen texture over the scene to give a fade effect. Setting Target Alpha to 1 will obscure the screen, alpha 0 will reveal the screen. If no Fade Texture is provided then a default flat color texture is used.
Defined in Fungus.Commands.FadeScreen
Property | Type | Description
--- | --- | ---
Duration | System.Single | Time for fade effect to complete
@ -14,6 +16,8 @@ Fade Texture | UnityEngine.Texture2D | Optional texture to use when rendering th
## Fade To View
Fades the camera out and in again at a position specified by a View object.
Defined in Fungus.Commands.FadeToView
Property | Type | Description
--- | --- | ---
Duration | System.Single | Time for fade effect to complete
@ -26,9 +30,13 @@ Target Camera | UnityEngine.Camera | Camera to use for the fade. Will use main c
## Fullscreen
Sets the application to fullscreen, windowed or toggles the current state.
Defined in Fungus.Commands.Fullscreen
## Move To View
Moves the camera to a location specified by a View object.
Defined in Fungus.Commands.MoveToView
Property | Type | Description
--- | --- | ---
Duration | System.Single | Time for move effect to complete
@ -39,6 +47,8 @@ Target Camera | UnityEngine.Camera | Camera to use for the pan. Will use main ca
## Shake Camera
Applies a camera shake effect to the main camera.
Defined in Fungus.Commands.ShakeCamera
Property | Type | Description
--- | --- | ---
Duration | System.Single | Time for camera shake effect to complete
@ -48,6 +58,8 @@ Wait Until Finished | System.Boolean | Wait until the shake effect has finished
## Start Swipe
Activates swipe panning mode where the player can pan the camera within the area between viewA & viewB.
Defined in Fungus.Commands.StartSwipe
Property | Type | Description
--- | --- | ---
View A | Fungus.View | Defines one extreme of the scrollable area that the player can pan around
@ -58,3 +70,5 @@ Target Camera | UnityEngine.Camera | Camera to use for the pan. Will use main ca
Execute another block in the same Flowchart as the command, or in a different Flowchart.
Defined in Fungus.Commands.Call
Property | Type | Description
--- | --- | ---
Target Flowchart | Fungus.Flowchart | Flowchart which contains the block to execute. If none is specified then the current Flowchart is used.
@ -14,9 +18,13 @@ Call Mode | Fungus.Commands.CallMode | Select if the calling block should stop o
## Else
Marks the start of a command block to be executed when the preceding If statement is False.
Defined in Fungus.Commands.Else
## Else If
Marks the start of a command block to be executed when the preceding If statement is False and the test expression is true.
Defined in Fungus.Commands.ElseIf
Property | Type | Description
--- | --- | ---
Variable | Fungus.Variable | Variable to use in expression
@ -28,9 +36,13 @@ Compare Operator | Fungus.CompareOperator | The type of comparison to be perform
## End
Marks the end of a conditional block.
Defined in Fungus.Commands.End
## If
If the test expression is true, execute the following command block.
Defined in Fungus.Commands.If
Property | Type | Description
--- | --- | ---
Variable | Fungus.Variable | Variable to use in expression
@ -43,6 +55,8 @@ Compare Operator | Fungus.CompareOperator | The type of comparison to be perform
## Jump
Move execution to a specific Label command in the same block
Defined in Fungus.Commands.Jump
Property | Type | Description
--- | --- | ---
_target Label | Fungus.Variables.StringData | Name of a label in this block to jump to
@ -50,6 +64,8 @@ _target Label | Fungus.Variables.StringData | Name of a label in this block to j
## Label
Marks a position in the command list for execution to jump to.
Defined in Fungus.Commands.Label
Property | Type | Description
--- | --- | ---
Key | System.String | Display name for the label
@ -57,6 +73,8 @@ Key | System.String | Display name for the label
## Load Scene
Loads a new Unity scene and displays an optional loading image. This is useful for splitting a large game across multiple scene files to reduce peak memory usage. Previously loaded assets will be released before loading the scene to free up memory.The scene to be loaded must be added to the scene list in Build Settings.
Defined in Fungus.Commands.LoadScene
Property | Type | Description
--- | --- | ---
_scene Name | Fungus.Variables.StringData | Name of the scene to load. The scene must also be added to the build settings.
@ -64,9 +82,13 @@ Loading Image | UnityEngine.Texture2D | Image to display while loading the scene
## Quit
Quits the application. Does not work in Editor or Webplayer builds. Shouldn't generally be used on iOS.
Defined in Fungus.Commands.Quit
## Send Message
Sends a message to either the owner Flowchart or all Flowcharts in the scene. Blocks can listen for this message using a Message Received event handler.
Defined in Fungus.Commands.SendMessage
Property | Type | Description
--- | --- | ---
Message Target | Fungus.Commands.MessageTarget | Target flowchart(s) to send the message to
@ -74,9 +96,13 @@ _message | Fungus.Variables.StringData | Name of the message to send
## Stop
Stop executing the Block that contains this command.
Defined in Fungus.Commands.Stop
## Stop Block
Stops executing the named Block
Defined in Fungus.Commands.StopBlock
Property | Type | Description
--- | --- | ---
Flowchart | Fungus.Flowchart | Flowchart containing the Block. If none is specified, the parent Flowchart is used.
@ -85,6 +111,8 @@ Block Name | Fungus.Variables.StringData | Name of the Block to stop
## Stop Flowchart
Stops execution of all Blocks in a Flowchart
Defined in Fungus.Commands.StopFlowchart
Property | Type | Description
--- | --- | ---
Stop Parent Flowchart | System.Boolean | Stop all executing Blocks in the Flowchart that contains this command
Instantly rotates a GameObject to look at the supplied Vector3 then returns it to it's starting rotation over time.
Defined in Fungus.Commands.LookFrom
Property | Type | Description
--- | --- | ---
_from Transform | Fungus.Variables.TransformData | Target transform that the GameObject will look at
@ -19,6 +21,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Look To
Rotates a GameObject to look at a supplied Transform or Vector3 over time.
Defined in Fungus.Commands.LookTo
Property | Type | Description
--- | --- | ---
_to Transform | Fungus.Variables.TransformData | Target transform that the GameObject will look at
@ -35,6 +39,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Move Add
Moves a game object by a specified offset over time.
Defined in Fungus.Commands.MoveAdd
Property | Type | Description
--- | --- | ---
_offset | Fungus.Variables.Vector3Data | A translation offset in space the GameObject will animate to
@ -50,6 +56,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Move From
Moves a game object from a specified position back to its starting position over time. The position can be defined by a transform in another object (using To Transform) or by setting an absolute position (using To Position, if To Transform is set to None).
Defined in Fungus.Commands.MoveFrom
Property | Type | Description
--- | --- | ---
_from Transform | Fungus.Variables.TransformData | Target transform that the GameObject will move from
@ -66,6 +74,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Move To
Moves a game object to a specified position over time. The position can be defined by a transform in another object (using To Transform) or by setting an absolute position (using To Position, if To Transform is set to None).
Defined in Fungus.Commands.MoveTo
Property | Type | Description
--- | --- | ---
_to Transform | Fungus.Variables.TransformData | Target transform that the GameObject will move to
@ -82,6 +92,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Punch Position
Applies a jolt of force to a GameObject's position and wobbles it back to its initial position.
Defined in Fungus.Commands.PunchPosition
Property | Type | Description
--- | --- | ---
_amount | Fungus.Variables.Vector3Data | A translation offset in space the GameObject will animate to
@ -97,6 +109,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Punch Rotation
Applies a jolt of force to a GameObject's rotation and wobbles it back to its initial rotation.
Defined in Fungus.Commands.PunchRotation
Property | Type | Description
--- | --- | ---
_amount | Fungus.Variables.Vector3Data | A rotation offset in space the GameObject will animate to
@ -112,6 +126,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Punch Scale
Applies a jolt of force to a GameObject's scale and wobbles it back to its initial scale.
Defined in Fungus.Commands.PunchScale
Property | Type | Description
--- | --- | ---
_amount | Fungus.Variables.Vector3Data | A scale offset in space the GameObject will animate to
@ -126,6 +142,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Rotate Add
Rotates a game object by the specified angles over time.
Defined in Fungus.Commands.RotateAdd
Property | Type | Description
--- | --- | ---
_offset | Fungus.Variables.Vector3Data | A rotation offset in space the GameObject will animate to
@ -141,6 +159,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Rotate From
Rotates a game object from the specified angles back to its starting orientation over time.
Defined in Fungus.Commands.RotateFrom
Property | Type | Description
--- | --- | ---
_from Transform | Fungus.Variables.TransformData | Target transform that the GameObject will rotate from
@ -157,6 +177,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Rotate To
Rotates a game object to the specified angles over time.
Defined in Fungus.Commands.RotateTo
Property | Type | Description
--- | --- | ---
_to Transform | Fungus.Variables.TransformData | Target transform that the GameObject will rotate to
@ -173,6 +195,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Scale Add
Changes a game object's scale by a specified offset over time.
Defined in Fungus.Commands.ScaleAdd
Property | Type | Description
--- | --- | ---
_offset | Fungus.Variables.Vector3Data | A scale offset in space the GameObject will animate to
@ -187,6 +211,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Scale From
Changes a game object's scale to the specified value and back to its original scale over time.
Defined in Fungus.Commands.ScaleFrom
Property | Type | Description
--- | --- | ---
_from Transform | Fungus.Variables.TransformData | Target transform that the GameObject will scale from
@ -202,6 +228,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Scale To
Changes a game object's scale to a specified value over time.
Defined in Fungus.Commands.ScaleTo
Property | Type | Description
--- | --- | ---
_to Transform | Fungus.Variables.TransformData | Target transform that the GameObject will scale to
@ -217,6 +245,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Shake Position
Randomly shakes a GameObject's position by a diminishing amount over time.
Defined in Fungus.Commands.ShakePosition
Property | Type | Description
--- | --- | ---
_amount | Fungus.Variables.Vector3Data | A translation offset in space the GameObject will animate to
@ -233,6 +263,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Shake Rotation
Randomly shakes a GameObject's rotation by a diminishing amount over time.
Defined in Fungus.Commands.ShakeRotation
Property | Type | Description
--- | --- | ---
_amount | Fungus.Variables.Vector3Data | A rotation offset in space the GameObject will animate to
@ -248,6 +280,8 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Shake Scale
Randomly shakes a GameObject's rotation by a diminishing amount over time.
Defined in Fungus.Commands.ShakeScale
Property | Type | Description
--- | --- | ---
_amount | Fungus.Variables.Vector3Data | A scale offset in space the GameObject will animate to
@ -262,9 +296,13 @@ Wait Until Finished | System.Boolean | Wait until the tween has finished before
## Stop Tween
Stops an active iTween by name.
Defined in Fungus.Commands.StopTween
Property | Type | Description
--- | --- | ---
_tween Name | Fungus.Variables.StringData | Stop and destroy any Tweens in current scene with the supplied name
Use comments to record design notes and reminders about your game.
Defined in Fungus.Commands.Comment
Property | Type | Description
--- | --- | ---
Commenter Name | System.String | Name of Commenter
@ -11,6 +13,8 @@ Comment Text | System.String | Text to display for this comment
## Call Method
Calls a named method on a GameObject using the GameObject.SendMessage() system.
Defined in Fungus.Commands.CallMethod
Property | Type | Description
--- | --- | ---
Target Object | UnityEngine.GameObject | Target monobehavior which contains the method we want to call
@ -20,6 +24,8 @@ Delay | System.Single | Delay (in seconds) before the method will be called
## Debug Log
Writes a log message to the debug console.
Defined in Fungus.Commands.DebugLog
Property | Type | Description
--- | --- | ---
Log Type | Fungus.Commands.DebugLogType | Display type of debug log info
@ -28,6 +34,8 @@ Log Message | Fungus.Variables.StringDataMulti | Text to write to the debug log.
## Destroy
Destroys a specified game object in the scene.
Defined in Fungus.Commands.Destroy
Property | Type | Description
--- | --- | ---
_target Game Object | Fungus.Variables.GameObjectData | Reference to game object to destroy
@ -35,6 +43,8 @@ _target Game Object | Fungus.Variables.GameObjectData | Reference to game object
## Execute Lua
Executes a Lua code chunk using a Lua Environment.
Defined in Fungus.Commands.ExecuteLua
Property | Type | Description
--- | --- | ---
Lua Environment | Fungus.LuaEnvironment | Lua Environment to use to execute this Lua script
@ -47,6 +57,8 @@ Return Variable | Fungus.Variable | A Flowchart variable to store the returned v
## Invoke Event
Calls a list of component methods via the Unity Event System (as used in the Unity UI). This command is more efficient than the Invoke Method command but can only pass a single parameter and doesn't support return values.
Defined in Fungus.Commands.InvokeEvent
Property | Type | Description
--- | --- | ---
Delay | System.Single | Delay (in seconds) before the methods will be called
@ -63,6 +75,8 @@ String Event | Fungus.Commands.InvokeEvent+StringEvent | List of methods to call
## Invoke Method
Invokes a method of a component via reflection. Supports passing multiple parameters and storing returned values in a Fungus variable.
Defined in Fungus.Commands.InvokeMethod
Property | Type | Description
--- | --- | ---
Target Object | UnityEngine.GameObject | GameObject containing the component method to be invoked
@ -81,6 +95,8 @@ Call Mode | Fungus.Commands.CallMode | The coroutine call behavior for methods t
## Open URL
Opens the specified URL in the browser.
Defined in Fungus.Commands.LinkToWebsite
Property | Type | Description
--- | --- | ---
Url | Fungus.Variables.StringData | URL to open in the browser
@ -88,6 +104,8 @@ Url | Fungus.Variables.StringData | URL to open in the browser
## Set Active
Sets a game object in the scene to be active / inactive.
Defined in Fungus.Commands.SetActive
Property | Type | Description
--- | --- | ---
_target Game Object | Fungus.Variables.GameObjectData | Reference to game object to enable / disable
@ -96,6 +114,8 @@ Active State | Fungus.Variables.BooleanData | Set to true to enable the game obj
## Spawn Object
Spawns a new object based on a reference to a scene or prefab game object.
Defined in Fungus.Commands.SpawnObject
Property | Type | Description
--- | --- | ---
_source Object | Fungus.Variables.GameObjectData | Game object to copy when spawning. Can be a scene object or a prefab.
Fades a sprite to a target color over a period of time.
Defined in Fungus.Commands.FadeSprite
Property | Type | Description
--- | --- | ---
Sprite Renderer | UnityEngine.SpriteRenderer | Sprite object to be faded
@ -13,6 +15,8 @@ Wait Until Finished | System.Boolean | Wait until the fade has finished before e
## Set Clickable 2D
Sets a Clickable2D component to be clickable / non-clickable.
Defined in Fungus.Commands.SetClickable2D
Property | Type | Description
--- | --- | ---
Target Clickable2 D | Fungus.Clickable2D | Reference to Clickable2D component on a gameobject
@ -21,6 +25,8 @@ Active State | Fungus.Variables.BooleanData | Set to true to enable the componen
## Set Collider
Sets all collider (2d or 3d) components on the target objects to be active / inactive
Defined in Fungus.Commands.SetCollider
Property | Type | Description
--- | --- | ---
Target Objects | System.Collections.Generic.List`1[UnityEngine.GameObject] | A list of gameobjects containing collider components to be set active / inactive
@ -30,6 +36,8 @@ Active State | Fungus.Variables.BooleanData | Set to true to enable the collider
## Set Draggable 2D
Sets a Draggable2D component to be draggable / non-draggable.
Defined in Fungus.Commands.SetDraggable2D
Property | Type | Description
--- | --- | ---
Target Draggable2 D | Fungus.Draggable2D | Reference to Draggable2D component on a gameobject
@ -38,6 +46,8 @@ Active State | Fungus.Variables.BooleanData | Set to true to enable the componen
## Set Mouse Cursor
Sets the mouse cursor sprite.
Defined in Fungus.Commands.SetMouseCursor
Property | Type | Description
--- | --- | ---
Cursor Texture | UnityEngine.Texture2D | Texture to use for cursor. Will use default mouse cursor if no sprite is specified
@ -46,6 +56,8 @@ Hot Spot | UnityEngine.Vector2 | The offset from the top left of the texture to
## Set Sorting Layer
Sets the Renderer sorting layer of every child of a game object. Applies to all Renderers (including mesh, skinned mesh, and sprite).
Defined in Fungus.Commands.SetSortingLayer
Property | Type | Description
--- | --- | ---
Target Object | UnityEngine.GameObject | Root Object that will have the Sorting Layer set. Any children will also be affected
@ -54,6 +66,8 @@ Sorting Layer | System.String | The New Layer Name to apply
## Set Sprite Order
Controls the render order of sprites by setting the Order In Layer property of a list of sprites.
Defined in Fungus.Commands.SetSpriteOrder
Property | Type | Description
--- | --- | ---
Target Sprites | System.Collections.Generic.List`1[UnityEngine.SpriteRenderer] | List of sprites to set the order in layer property on
@ -62,6 +76,8 @@ Order In Layer | Fungus.Variables.IntegerData | The order in layer value to set
## Show Sprite
Makes a sprite visible / invisible by setting the color alpha.
Defined in Fungus.Commands.ShowSprite
Property | Type | Description
--- | --- | ---
Sprite Renderer | UnityEngine.SpriteRenderer | Sprite object to be made visible / invisible
Key | System.String | Name of the saved value. Supports variable substition e.g. "player_{$PlayerNumber}
@ -10,6 +12,8 @@ Key | System.String | Name of the saved value. Supports variable substition e.g.
## Load Variable
Loads a saved value and stores it in a Boolean, Integer, Float or String variable. If the key is not found then the variable is not modified.
Defined in Fungus.Commands.LoadVariable
Property | Type | Description
--- | --- | ---
Key | System.String | Name of the saved value. Supports variable substition e.g. "player_{$PlayerNumber}"
@ -18,6 +22,8 @@ Variable | Fungus.Variable | Variable to store the value in.
## Random Float
Sets an float variable to a random value in the defined range.
Defined in Fungus.Commands.RandomFloat
Property | Type | Description
--- | --- | ---
Variable | Fungus.Variables.FloatVariable | The variable whos value will be set
@ -27,6 +33,8 @@ Max Value | Fungus.Variables.FloatData | Maximum value for random range
## Random Integer
Sets an integer variable to a random value in the defined range.
Defined in Fungus.Commands.RandomInteger
Property | Type | Description
--- | --- | ---
Variable | Fungus.Variables.IntegerVariable | The variable whos value will be set
@ -36,6 +44,8 @@ Max Value | Fungus.Variables.IntegerData | Maximum value for random range
## Read Text File
Reads in a text file and stores the contents in a string variable
Defined in Fungus.Commands.ReadTextFile
Property | Type | Description
--- | --- | ---
Text File | UnityEngine.TextAsset | Text file to read into the string variable
@ -44,6 +54,8 @@ String Variable | Fungus.Variables.StringVariable | String variable to store the
## Reset
Resets the state of all commands and variables in the Flowchart.
Defined in Fungus.Commands.Reset
Property | Type | Description
--- | --- | ---
Reset Commands | System.Boolean | Reset state of all commands in the script
@ -52,6 +64,8 @@ Reset Variables | System.Boolean | Reset variables back to their default values
## Save Variable
Save an Boolean, Integer, Float or String variable to persistent storage using a string key. The value can be loaded again later using the Load Variable command. You can also use the Set Save Profile command to manage separate save profiles for multiple players.
Defined in Fungus.Commands.SaveVariable
Property | Type | Description
--- | --- | ---
Key | System.String | Name of the saved value. Supports variable substition e.g. "player_{$PlayerNumber}
@ -60,6 +74,8 @@ Variable | Fungus.Variable | Variable to read the value from. Only Boolean, Inte
## Set Save Profile
Sets the active profile that the Save Variable and Load Variable commands will use. This is useful to crete multiple player save games. Once set, the profile applies across all Flowcharts and will also persist across scene loads.
Defined in Fungus.Commands.SetSaveProfile
Property | Type | Description
--- | --- | ---
Save Profile Name | System.String | Name of save profile to make active.
@ -67,6 +83,8 @@ Save Profile Name | System.String | Name of save profile to make active.
## Set Variable
Sets a Boolean, Integer, Float or String variable to a new value using a simple arithmetic operation. The value can be a constant or reference another variable of the same type.
Defined in Fungus.Commands.SetVariable
Property | Type | Description
--- | --- | ---
Variable | Fungus.Variable | The variable whos value will be set