diff --git a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs index 2c050c2e3..5e2792dc4 100644 --- a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs +++ b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs @@ -541,7 +541,7 @@ namespace FlaxEditor.SceneGraph.GUI var customAction = targetActor.HasPrefabLink ? new ReparentAction(targetActor) : null; using (new UndoBlock(ActorNode.Root.Undo, targetActor, "Change actor parent", customAction)) { - targetActor.SetParent(newParent, worldPositionLock); + targetActor.SetParent(newParent, worldPositionLock, true); targetActor.OrderInParent = newOrder; } } @@ -554,7 +554,7 @@ namespace FlaxEditor.SceneGraph.GUI for (int i = 0; i < targetActors.Count; i++) { var targetActor = targetActors[i]; - targetActor.SetParent(newParent, worldPositionLock); + targetActor.SetParent(newParent, worldPositionLock, true); targetActor.OrderInParent = newOrder; } } diff --git a/Source/Engine/Level/Actor.cs b/Source/Engine/Level/Actor.cs index 2d9c27b9a..fce009549 100644 --- a/Source/Engine/Level/Actor.cs +++ b/Source/Engine/Level/Actor.cs @@ -124,7 +124,7 @@ namespace FlaxEngine public Actor AddChild(Type type) { var result = (Actor)New(type); - result.SetParent(this, false); + result.SetParent(this, false, false); return result; } @@ -136,7 +136,7 @@ namespace FlaxEngine public T AddChild() where T : Actor { var result = New(); - result.SetParent(this, false); + result.SetParent(this, false, false); return result; } @@ -173,7 +173,7 @@ namespace FlaxEngine if (result == null) { result = New(); - result.SetParent(this, false); + result.SetParent(this, false, false); } return result; } diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h index 560403890..9f46bfa5e 100644 --- a/Source/Engine/Level/Actor.h +++ b/Source/Engine/Level/Actor.h @@ -176,7 +176,7 @@ public: /// New parent /// Should actor world positions remain the same after parent change? /// True if can break prefab link on changing the parent. - void SetParent(Actor* value, bool worldPositionsStays, bool canBreakPrefabLink); + API_FUNCTION() void SetParent(Actor* value, bool worldPositionsStays, bool canBreakPrefabLink); /// /// Gets amount of child actors.