fix Robot Cam network authority
This commit is contained in:
parent
25d3de49e7
commit
02aa35e0a3
@ -110,18 +110,22 @@ public class RobotController : NetworkBehaviour
|
|||||||
|
|
||||||
public override void OnNetworkSpawn()
|
public override void OnNetworkSpawn()
|
||||||
{
|
{
|
||||||
|
base.OnNetworkSpawn();
|
||||||
|
|
||||||
playerInput.enabled = IsOwner;
|
playerInput.enabled = IsOwner;
|
||||||
characterController.enabled = IsOwner;
|
characterController.enabled = IsOwner;
|
||||||
base.OnNetworkSpawn();
|
mainCam.enabled = IsOwner;
|
||||||
|
|
||||||
Debug.Log($"NetworkObject ID: {NetworkObjectId} spawned with OwnerClientId: {OwnerClientId}");
|
Debug.Log($"NetworkObject ID: {NetworkObjectId} spawned with OwnerClientId: {OwnerClientId}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnNetworkDespawn()
|
public override void OnNetworkDespawn()
|
||||||
{
|
{
|
||||||
|
base.OnNetworkDespawn();
|
||||||
|
|
||||||
playerInput.enabled = false;
|
playerInput.enabled = false;
|
||||||
characterController.enabled = false;
|
characterController.enabled = false;
|
||||||
base.OnNetworkDespawn();
|
mainCam.enabled = false;
|
||||||
|
|
||||||
Debug.Log($"NetworkObject ID: {NetworkObjectId} despawned");
|
Debug.Log($"NetworkObject ID: {NetworkObjectId} despawned");
|
||||||
}
|
}
|
||||||
@ -132,9 +136,7 @@ public class RobotController : NetworkBehaviour
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debug.Log("Update(currentMovement.y): " + currentMovement.y);
|
|
||||||
HandleMovement();
|
|
||||||
HandleRotation();
|
HandleRotation();
|
||||||
InternalLockUpdate();
|
InternalLockUpdate();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user