From f0f1c57ff19d3464e2dea5c2584558081cc79fc6 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 24 Mar 2026 19:43:37 +0100 Subject: [PATCH] Add scrolling scene tree hierarchy to the newly spawned actor after drag and drop --- Source/Editor/Viewport/ViewportDraggingHelper.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Editor/Viewport/ViewportDraggingHelper.cs b/Source/Editor/Viewport/ViewportDraggingHelper.cs index 21287fc94..3e6fce6ad 100644 --- a/Source/Editor/Viewport/ViewportDraggingHelper.cs +++ b/Source/Editor/Viewport/ViewportDraggingHelper.cs @@ -198,6 +198,11 @@ namespace FlaxEditor.Viewport actor.Position = PostProcessSpawnedActorLocation(actor, ref hitLocation); _owner.Spawn(actor); _viewport.Focus(); + + // Scroll to the new actor in the hierarchy + var actorNode = Editor.Instance.Scene.GetActorNode(actor); + if (actorNode?.TreeNode.ParentTree.Parent is Panel treePanel) + FlaxEngine.Scripting.InvokeOnUpdate(() => treePanel.ScrollViewTo(actorNode.TreeNode)); } private void Spawn(ScriptItem item, SceneGraphNode hit, ref Float2 location, ref Vector3 hitLocation, ref Vector3 hitNormal)