diff --git a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs
index e71f9a8bc..583241915 100644
--- a/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs
+++ b/Source/Editor/CustomEditors/Dedicated/ScriptsEditor.cs
@@ -424,6 +424,13 @@ namespace FlaxEditor.CustomEditors.Dedicated
{
presenter.Undo.AddAction(multiAction);
presenter.Control.Focus();
+
+ // Scroll to bottom of script control where a new script is added.
+ if (presenter.Panel.Parent is Panel p && Editor.Instance.Options.Options.Interface.ScrollToScriptOnAdd)
+ {
+ var loc = ScriptsEditor.Layout.Control.BottomLeft;
+ p.ScrollViewTo(loc);
+ }
}
}
}
diff --git a/Source/Editor/Options/InterfaceOptions.cs b/Source/Editor/Options/InterfaceOptions.cs
index 1654df920..4cd76adc6 100644
--- a/Source/Editor/Options/InterfaceOptions.cs
+++ b/Source/Editor/Options/InterfaceOptions.cs
@@ -258,6 +258,13 @@ namespace FlaxEditor.Options
private TextAlignment _tooltipTextAlignment = TextAlignment.Center;
+ ///
+ /// Whether to scroll to the script when a script is added to an actor.
+ ///
+ [DefaultValue(true)]
+ [EditorDisplay("Interface"), EditorOrder(322)]
+ public bool ScrollToScriptOnAdd { get; set; } = true;
+
///
/// Gets or sets the timestamps prefix mode for output log messages.
///