problem with a third person camera

Hey guys,

I am working on a game that uses a multiplayer script where I need to spawn 1 prefab per player which includes the player model and camera.

I have a character setup with the unity third person controller, animations and player control scripts.
For the camera I use the freelookcam script for unity to orbit around my player when idle and use the mouse to control the direction of the player when moving.

The problem is that the freelookcam works perfectly when its not parented to the thirdpersoncontroller but I have to parent it for the multiplayer scripts to spawn both and when I parent it to the thirdpersoncontroller the movement speed of the camera increases a lot and it gets laggy camera movement.

Does anyone have an idea on how to fix this?

If you’re unable to adjust the multiplayer script to allow spawning 2 prefabs, then the idea that comes to mind is to unparent the camera from the player. Depending on how it all works between the multiplayer system, the player controller, and the camera controller, this may or may not work for you. Try adding this to the Camera script. If it already has an Awake method, add the line to the top of it.

void Awake()
     transform.parent = null;

This should unparent the camera from the player object as soon as it gets spawned.