camera following player on path

Hi,

is there a good workaround for a camera which is following the player on a predefined path (not behind, but on the side of the player)?

you can set camera’s position as you wish:

always behind player

Camera.main.transform.position = playerTransform.position - playerTransform.forward * 3f;

always to right of player

Camera.main.transform.position = playerTransform.position + playerTransform.right* 3f;

always to right in world space (camera will not rotate on player’s rotate)

Camera.main.transform.position = playerTransform.position + Vector3.right* 3f;

always to right and a little at top of player

Camera.main.transform.position = playerTransform.position + playerTransform.right* 3f + playerTransform.up;

also, don’t forget to set ‘look at’ for camera to turn it to player

applying setting position in Update will move camera always following the player

Well you could implement a bezier curve or an array of them.

For this you could also use Unity - Scripting API: AnimationCurve in your code.

This is a somewhat complex matter, I think this tip is a good starting point for your research.