Hello Community, this is my script:
using UnityEngine;
public class CameraFollow : MonoBehaviour
{
// Player reference
private GameObject player;
private void Start()
{
player = GameObject.FindGameObjectWithTag("Player");
}
// Follow the player after his movement is completed.
private void LateUpdate()
{
transform.position = player.transform.position;
transform.rotation = player.transform.rotation;
}
}
This works fine, if I press and hold W, A or D it keeps following the player as he moves or rotates, however holding the S key makes the movement to stutter, maybe there is a collision with something but both camera arm and camera are away from player so I don’t know why this happens.
The camera arm’s position is (0.5, 0.5, 0.5) and the child MainCamera is (0.23, 1.56, -1.58), it should look like this
I appreciate anyone please explain me why this happens. Thank you!