.vs
Assets
Library
APIUpdater
Artifacts
Bee
BuildPlayerData
PackageCache
com.unity.collab-proxy@2.5.2
com.unity.editorcoroutines@1.0.0
com.unity.ext.nunit@1.0.6
com.unity.feature.development@1.0.1
com.unity.ide.rider@3.0.31
com.unity.ide.visualstudio@2.0.22
com.unity.ide.vscode@1.2.5
com.unity.modules.ai@1.0.0
com.unity.modules.androidjni@1.0.0
com.unity.modules.animation@1.0.0
com.unity.modules.assetbundle@1.0.0
com.unity.modules.audio@1.0.0
com.unity.modules.cloth@1.0.0
com.unity.modules.director@1.0.0
com.unity.modules.imageconversion@1.0.0
com.unity.modules.imgui@1.0.0
com.unity.modules.jsonserialize@1.0.0
com.unity.modules.particlesystem@1.0.0
com.unity.modules.physics2d@1.0.0
com.unity.modules.physics@1.0.0
com.unity.modules.screencapture@1.0.0
com.unity.modules.subsystems@1.0.0
com.unity.modules.terrain@1.0.0
com.unity.modules.terrainphysics@1.0.0
com.unity.modules.tilemap@1.0.0
com.unity.modules.ui@1.0.0
com.unity.modules.uielements@1.0.0
com.unity.modules.umbra@1.0.0
com.unity.modules.unityanalytics@1.0.0
com.unity.modules.unitywebrequest@1.0.0
com.unity.modules.unitywebrequestassetbundle@1.0.0
com.unity.modules.unitywebrequestaudio@1.0.0
com.unity.modules.unitywebrequesttexture@1.0.0
com.unity.modules.unitywebrequestwww@1.0.0
com.unity.modules.vehicles@1.0.0
com.unity.modules.video@1.0.0
com.unity.modules.vr@1.0.0
com.unity.modules.wind@1.0.0
com.unity.modules.xr@1.0.0
com.unity.performance.profile-analyzer@1.2.2
com.unity.settings-manager@2.0.1
com.unity.test-framework@1.1.33
com.unity.testtools.codecoverage@1.2.6
com.unity.textmeshpro@3.0.6
com.unity.timeline@1.7.6
com.unity.ugui@1.0.0
com.unity.visualscripting@1.9.4
Documentation~
images
snippets
TableOfContents.md
index.md
vs-add-custom-event-node-trigger.md
vs-add-custom-event-node.md
vs-add-inspectable-attribute-custom-types.md
vs-add-node-to-graph.md
vs-add-remove-node-library.md
vs-add-remove-type-options.md
vs-add-subgraph.md
vs-add-triggers-data-graph.md
vs-add-variable-graph.md
vs-advanced-topics-intro.md
vs-aot.md
vs-attach-graph-machine.md
vs-basic-concepts.md
vs-capture-player-input-add-component.md
vs-capture-player-input.md
vs-capturing-player-inputs-new.md
vs-capturing-player-inputs-old.md
vs-configuration.md
vs-control-schemes.md
vs-control.md
vs-create-custom-drawer.md
vs-create-custom-node-add-docs.md
vs-create-custom-node-add-logic.md
vs-create-custom-node-add-ports.md
vs-create-custom-node-add-relations.md
vs-create-custom-node-attributes-reference.md
vs-create-custom-node-empty.md
vs-create-custom-node.md
vs-create-graph-assign-existing-gameobject.md
vs-create-graph-assign-new-gameobject.md
vs-create-graph-on-machine.md
vs-create-graph-project-window.md
vs-create-graph-unassigned-flow.md
vs-create-graph.md
vs-create-own-custom-event-listen-code.md
vs-create-own-custom-event-node-trigger-code.md
vs-create-own-custom-event-node.md
vs-create-own-custom-event-send-node.md
vs-create-restore-backups.md
vs-create-state.md
vs-creating-connections.md
vs-creating-transition.md
vs-custom-events.md
vs-custom-types.md
vs-debug-messages.md
vs-debugging.md
vs-developers-guide.md
vs-editor-script-issues.md
vs-events-reference.md
vs-events.md
vs-formula.md
vs-graph-machine-types.md
vs-graph-types.md
vs-groups.md
vs-input-nodes.md
vs-interface-overview.md
vs-live-edit-runtime.md
vs-live.md
vs-nesting-add-state-unit.md
vs-nesting-add-subgraph.md
vs-nesting-add-triggers-data-graph.md
vs-nesting-input-node.md
vs-nesting-nodes.md
vs-nesting-output-node.md
vs-nesting-state-unit-node.md
vs-nesting-subgraph-node.md
vs-nesting-subgraphs-state-units.md
vs-nodes-events-input-system-button.md
vs-nodes-events-input-system-float.md
vs-nodes-events-input-system-vector2.md
vs-nodes-events-on-button-input.md
vs-nodes-events-on-keyboard-input.md
vs-nodes-events-on-mouse-down.md
vs-nodes-events-on-mouse-drag.md
vs-nodes-events-on-mouse-enter.md
vs-nodes-events-on-mouse-exit.md
vs-nodes-events-on-mouse-input.md
vs-nodes-events-on-mouse-over.md
vs-nodes-events-on-mouse-up-button.md
vs-nodes-events-on-mouse-up.md
vs-nodes-reference.md
vs-nodes.md
vs-nulls.md
vs-open-graph-edit.md
vs-refactor-add-attribute.md
vs-refactoring.md
vs-relations.md
vs-script-graphs-intro.md
vs-scripts-reference.md
vs-self.md
vs-set-preferences.md
vs-state-graphs-intro.md
vs-states-reference.md
vs-sticky-notes.md
vs-time.md
vs-transitions.md
vs-types.md
vs-update.md
vs-using-custom-types.md
vs-variables-api.md
vs-variables-reference.md
vs-variables.md
vs-version-control.md
Editor
Graphics
Runtime
.npmignore.release
.signature
CHANGELOG.md
CHANGELOG.md.meta
Editor.meta
Graphics.meta
LICENSE.md
LICENSE.md.meta
README.md
README.md.meta
Runtime.meta
Third Party Notices.md
Third Party Notices.md.meta
ValidationConfig.json
ValidationConfig.json.meta
ValidationExceptions.json
ValidationExceptions.json.meta
package.json
package.json.meta
PackageManager
PlayModeViewStates
PlayerDataCache
ScriptAssemblies
Search
ShaderCache
SplashScreenCache
StateCache
UIElements
AnnotationManager
ArtifactDB
ArtifactDB-lock
BuildPlayer.prefs
BuildSettings.asset
EditorOnlyScriptingSettings.json
EditorOnlyVirtualTextureState.json
EditorSnapSettings.asset
EditorUserBuildSettings.asset
InspectorExpandedItems.asset
LastBuild.buildreport
LastSceneManagerSetup.txt
LibraryFormatVersion.txt
MonoManager.asset
SceneVisibilityState.asset
ScriptMapper
ShaderCache.db
SourceAssetDB
SourceAssetDB-lock
SpriteAtlasDatabase.asset
Style.catalog
expandedItems
ilpp.pid
Logs
Packages
ProjectSettings
UserSettings
obj
.vsconfig
Assembly-CSharp.Player.csproj
Assembly-CSharp.csproj
TM1.sln
Unity.CollabProxy.Editor.csproj
Unity.EditorCoroutines.Editor.csproj
Unity.Performance.Profile-Analyzer.Editor.csproj
Unity.PlasticSCM.Editor.csproj
Unity.Rider.Editor.csproj
Unity.Settings.Editor.csproj
Unity.TestTools.CodeCoverage.Editor.OpenCover.Model.csproj
Unity.TestTools.CodeCoverage.Editor.OpenCover.Mono.Reflection.csproj
Unity.TestTools.CodeCoverage.Editor.csproj
Unity.TextMeshPro.Editor.csproj
Unity.TextMeshPro.Player.csproj
Unity.TextMeshPro.csproj
Unity.Timeline.Editor.csproj
Unity.Timeline.Player.csproj
Unity.Timeline.csproj
Unity.VSCode.Editor.csproj
Unity.VisualScripting.Core.Editor.csproj
Unity.VisualScripting.Core.Player.csproj
Unity.VisualScripting.Core.csproj
Unity.VisualScripting.Flow.Editor.csproj
Unity.VisualScripting.Flow.Player.csproj
Unity.VisualScripting.Flow.csproj
Unity.VisualScripting.SettingsProvider.Editor.csproj
Unity.VisualScripting.Shared.Editor.csproj
Unity.VisualScripting.State.Editor.csproj
Unity.VisualScripting.State.Player.csproj
Unity.VisualScripting.State.csproj
Unity.VisualStudio.Editor.csproj
UnityEditor.TestRunner.csproj
UnityEditor.UI.csproj
UnityEngine.TestRunner.Player.csproj
UnityEngine.TestRunner.csproj
UnityEngine.UI.Player.csproj
UnityEngine.UI.csproj
41 lines
2.8 KiB
Markdown
41 lines
2.8 KiB
Markdown
# Add a Custom Event Trigger node
|
|
|
|
You can use a Custom Event Trigger node to trigger a matching Custom Event node in your application. For more information on custom Events, see [Custom Events](vs-custom-events.md).
|
|
|
|
> [!NOTE]
|
|
> Before you add a Custom Event Trigger node, you must add and configure a Custom Event node in a Script Graph. For more information, see [Add a Custom Event node](vs-add-custom-event-node.md).
|
|
|
|
To add a Custom Event Trigger node to a Script Graph:
|
|
|
|
1. [Open the Script Graph](vs-open-graph-edit.md) where you want to add a Custom Event Trigger node. This can be the same graph or a different graph from where you added a Custom Event node.
|
|
|
|
2. [!include[open-fuzzy-finder](./snippets/vs-open-fuzzy-finder.md)].
|
|
|
|
1. Go to **Events**.
|
|
|
|
1. Select the **Custom Event Trigger** node to add it to the graph.
|
|
|
|
3. In the **Name** input port's field, enter the name of the Custom Event node you want to trigger, exactly as it appears on the Custom Event node, through one of the following methods:
|
|
|
|
- Enter the name in the field next to the **Name** input port.
|
|
- Attach a node that outputs the name as a string value to the **Name** input port.
|
|
|
|
4. In the **GameObject** field, indicated by the GameObject icon on the node, specify the GameObject that you want to trigger your Event. This doesn't have to be the same GameObject as the Custom Event node. Do one of the following:
|
|
|
|
- Select the object picker (circle icon) and select the GameObject.
|
|
- Attach a node to the field's data input port that outputs the GameObject.
|
|
- Leave the field as the default value of **This** to use the GameObject from your currently open Script Graph's Script Machine.
|
|
|
|
5. In the **Arguments** field, enter the number from your Custom Event node's **Arguments** field.
|
|
|
|
> [!NOTE]
|
|
> All arguments on a Custom Event Trigger node must receive input values, even if the Custom Event node doesn't use those arguments. Otherwise, Visual Scripting displays an error in the Graph Inspector for the Custom Event Trigger node.
|
|
|
|

|
|
|
|
## Next steps
|
|
|
|
You can [add more nodes](vs-add-node-to-graph.md) and [connect them](vs-creating-connections.md) to create the trigger logic for your Custom Event node in the graph.
|
|
|
|
You can also [create a Custom Scripting Event node](vs-create-own-custom-event-node.md).
|