Fix snapping rigidbodies to the floor

This commit is contained in:
Wojtek Figat
2021-11-02 15:16:35 +01:00
parent 62b0d19866
commit f8e63f2994

View File

@@ -524,7 +524,10 @@ namespace FlaxEditor.Gizmo
if (hit != null)
{
// Skip snapping selection to itself
if (IsSelected(hit))
bool isSelected = false;
for (var e = hit; e != null && !isSelected; e = e.ParentNode)
isSelected |= IsSelected(e);
if (isSelected)
{
GetSelectedObjectsBounds(out var selectionBounds, out _);
ray.Position = ray.GetPoint(selectionBounds.Size.Y * 0.5f);