Files
.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
SimonSayeBabu bd1057cec0 first commit
2025-01-17 13:10:20 +01:00

42 lines
2.2 KiB
Markdown

# Attach a graph file to a Script Machine or State Machine
To use a Script Graph or State Graph file in your project, you must attach it to a Script Machine or State Machine.
A Script Machine or State Machine is a component. Components attach to GameObjects, and help define their behavior. For more information on components and GameObjects, see [Using components](https://docs.unity3d.com/2021.1/Documentation/Manual/UsingComponents.html) or [GameObjects](https://docs.unity3d.com/2021.1/Documentation/Manual/GameObjects.html) in the Unity User Manual.
## Add a Script Machine or State Machine component to a GameObject
1. [!include[open-hierarchy](./snippets/vs-open-hierarchy-window.md)]
1. In the Hierarchy window, select a GameObject where you'd like to add a Script Machine or State Machine.
2. [!include[open-inspector-window](./snippets/vs-open-inspector-window.md)]
3. In the GameObject's Inspector window, select **Add Component**.
The Components menu opens.
4. Do one of the following:
- To add a Script Machine or State Machine, in the Components menu, go to **Visual Scripting** and select **Script Machine** or **State Machine**.
- Use the search bar to find the Script Machine or State Machine component.
The new Script Machine or State Machine component appears in the Inspector window for the GameObject:
![A new blank Script Machine component in the Inspector window for a GameObject](images\vs-script-machine-blank.png)
## Attach a graph file to the Script Machine or State Machine
1. In the Inspector window, locate your Script Machine or State Machine component.
1. Set the **Source** to **Graph**.
2. Do one of the following:
- In the **Graph** field, select the object picker (circle icon) and choose a compatible graph file from your project.
- Click and drag a file from your Project window and drop it into the **Graph** field.
For more information on how to create Script or State Graphs, see [Create a new graph file](vs-create-graph.md).
## Next steps
After you attach a graph to a Script Machine or State Machine, you can open the graph and edit. For more information, see [Open a graph file](vs-open-graph-edit.md).