So moving from single player to networked, i'm having some issues (probably my own stupidity) setting up my camera follow script.
Here's how i'm trying to implement it :
the game scene client side has a camera that exists on level load. my follow script is attached but disabled by default.
when a player joins a match, in that player's start function i get a reference to that camera, and
if (tno.isMine)
{
playerCam.enabled = true;
playerCam.GetComponent<ThirdPersonCamera>().createTarget(transform);
}
in my camera script i have a function that takes in a transform and sets its target to look at as that transform and its position attempts to be behind that transform by <distanceOffset> units,
but passing it the transform when a player is created doesn't seem to work. I debug logged on the camera in its create target function what the transform is, and it seems to get a reference to the player object just fine with this method.
Any thoughts?
Should i be using a create for the camera when player is created? My thinking was that i would run into issues having to check for other cameras and delete them client side, since technically only 1 camera is needed per client.
thanks in advance for help
