Character camera and movement fix - maybe
This commit is contained in:
@@ -268,6 +268,12 @@ namespace MegaKoop.Game.Networking
|
||||
}
|
||||
}
|
||||
|
||||
var controller = clone.GetComponent<ThirdPersonCharacterController>();
|
||||
if (!info.IsLocal && controller != null)
|
||||
{
|
||||
controller.SetCameraTransform(null);
|
||||
}
|
||||
|
||||
// Ensure only the local player's camera remains active and is MainCamera
|
||||
if (info.IsLocal)
|
||||
{
|
||||
@@ -297,7 +303,6 @@ namespace MegaKoop.Game.Networking
|
||||
}
|
||||
|
||||
// Bind the character controller to this camera for input-relative movement
|
||||
var controller = clone.GetComponent<ThirdPersonCharacterController>();
|
||||
if (controller != null)
|
||||
{
|
||||
Transform camTransform = thirdPersonCamera != null ? thirdPersonCamera.transform : (Camera.main != null ? Camera.main.transform : null);
|
||||
@@ -306,6 +311,11 @@ namespace MegaKoop.Game.Networking
|
||||
controller.SetCameraTransform(camTransform);
|
||||
}
|
||||
}
|
||||
|
||||
if (inputSender != null && thirdPersonCamera != null)
|
||||
{
|
||||
inputSender.SetCameraTransform(thirdPersonCamera.transform);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user