.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
58 lines
1.9 KiB
Markdown
58 lines
1.9 KiB
Markdown
![]() |
# Create and assign a graph to an existing GameObject
|
||
|
|
||
|
You can use the empty graph creation flow to create a new graph file and assign it to an existing GameObject in your project.
|
||
|
|
||
|

|
||
|
|
||
|
For more information on other ways to create a graph file, see [Create a new graph file](vs-create-graph.md).
|
||
|
|
||
|
## Create a Script Graph
|
||
|
|
||
|
To create a new Script Graph and assign it to an existing GameObject:
|
||
|
|
||
|
1. [!include[open-hierarchy-window](./snippets/vs-open-hierarchy-window.md)]
|
||
|
|
||
|
1. In the Hierarchy window, select the GameObject where you want to assign the new graph.
|
||
|
|
||
|
2. [!include[visual-scripting-window](./snippets/vs-visual-scripting-window.md)]
|
||
|
|
||
|
3. Expand **Create new Script Graph**.
|
||
|
|
||
|
1. Select **on selected game object**.
|
||
|
|
||
|
4. Choose a location to save the new graph file.
|
||
|
|
||
|
1. Enter a name for the graph.
|
||
|
|
||
|
1. Select **Save**.
|
||
|
|
||
|
The new graph file automatically opens in a new window.
|
||
|
|
||
|

|
||
|
|
||
|
## Create a State Graph
|
||
|
|
||
|
To create a new State Graph and assign it to an existing GameObject:
|
||
|
|
||
|
1. [!include[open-hierarchy-window](./snippets/vs-open-hierarchy-window.md)]
|
||
|
|
||
|
1. In the Hierarchy window, select the GameObject where you want to assign the new graph.
|
||
|
|
||
|
2. [!include[visual-scripting-window](./snippets/vs-visual-scripting-window.md)]
|
||
|
|
||
|
3. Expand **Create new State Graph**.
|
||
|
|
||
|
1. Select **on selected game object**.
|
||
|
|
||
|
4. Choose a location to save the new graph file.
|
||
|
|
||
|
1. Enter a name for the graph.
|
||
|
|
||
|
1. Select **Save**.
|
||
|
|
||
|
The new graph file automatically opens in a new window.
|
||
|
|
||
|
## Next steps
|
||
|
|
||
|
After you create a new graph, attach it to a Script Machine or State Machine to use it in your application. For more information, see [Attach a graph file to a Script Machine or State Machine](vs-attach-graph-machine.md).
|