- Home /
Make camera follow player and align direction
Right now I make my camera following my player using the following script:
public class CameraController : MonoBehaviour
{
public Player player;
private Vector3 offset;
void Start()
{
offset = transform.position - player.transform.position;
}
void LateUpdate()
{
transform.position = player.transform.position + offset ;
}
}
Which follows it really good. But my player is positioned at the edge of the camera. So if you look right, you stand on the entire left and see very far further and when you turn to the left, the camera should go to the left also so that the player stands on the right end of the camera
The cube represents the player and as you can see, he's at the left and moving to the right. So when the player turns, he should be moving to the left and at the right point of the camera.
I'm now wondering how I can make the camera go to another position with an animation (so that it goes frame by frame (smooth) and not immediately at once
Your answer
Follow this Question
Related Questions
How can camera smoothly follow a jerky game object? (bouncing up and down) 1 Answer
Resetting Camera with a key input 1 Answer
Returning the camera back to original position, 1 Answer
Camera smooth follow behaviour 0 Answers
Camera View Problem 0 Answers