for those who are having difficult with getting thier camera fix to base when joined as client …here is simple way to do it …
in your unitbase script add these line
public static event Action clientOnBaseSpawned;
public override void OnStartClient()
{
if (!isOwned) { return; }
clinetOnBaseSpawned?.Invoke(this);
}
and then in camera controller add these line
public override void OnStartClient()
{
UnitBase.clientOnBaseSpawned += clientHandleBaseSpawned;
}
public override void OnStopClient()
{
UnitBase.clientOnBaseSpawned -= clientHandleBaseSpawned;
}
private void clientHandleBaseSpawned(UnitBase unitbase)
{
playerCameraTransform.position = new Vector3(unitbase.transform.position.x, playerCameraTransform.position.y, unitbase.transform.position.z);
}