Fix reparenting actors in editor to preserve world position

#500
This commit is contained in:
Wojtek Figat
2021-05-14 13:01:25 +02:00
parent fbb9fa065a
commit 5f851d2433
3 changed files with 6 additions and 6 deletions

View File

@@ -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;
}
}