Skip to content

Commit 0797148

Browse files
Added checks to avoid the look-at feature from getting in the way of the connector commands.
1 parent 2604dd8 commit 0797148

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/UI/Panels/FreeCamPanel.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,11 @@ void FarClipInput_OnEndEdit(string input)
734734
UpdateClippingPlanes();
735735
}
736736

737+
public static bool IsConnectorActive()
738+
{
739+
return FreeCamPanel.connector != null && FreeCamPanel.connector.IsActive;
740+
}
741+
737742
public static bool ShouldOverrideInput(){
738743
return inFreeCamMode && blockGamesInputOnFreecamToggle.isOn;
739744
}
@@ -849,17 +854,17 @@ internal void Update()
849854
FreeCamPanel.followObjectLastRotation = FreeCamPanel.followObject.transform.rotation;
850855
}
851856

857+
if (FreeCamPanel.lookAtObject != null && !FreeCamPanel.IsConnectorActive())
858+
{
859+
movingTransform.LookAt(FreeCamPanel.lookAtObject.transform);
860+
}
861+
852862
UpdateRelativeMatrix();
853863
UpdateRealCamera();
854864

855865
FreeCamPanel.connector?.ExecuteCameraCommand(FreeCamPanel.GetFreecam());
856866

857867
FreeCamPanel.UpdatePositionInput();
858-
859-
if (FreeCamPanel.lookAtObject != null)
860-
{
861-
movingTransform.LookAt(FreeCamPanel.lookAtObject.transform);
862-
}
863868
}
864869
}
865870

0 commit comments

Comments
 (0)