Hello my camera follow script is :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CamSmoothFollow : MonoBehaviour
{
public float smoothTimeY, smoothTimeX;
Vector2 velocity;
public GameObject karakter;
public float offsetX, offsetY;
private void FixedUpdate()
{
float posX = Mathf.SmoothDamp(transform.position.x, karakter.transform.position.x, ref velocity.x, smoothTimeX);
float posY = Mathf.SmoothDamp(transform.position.y, karakter.transform.position.y, ref velocity.y, smoothTimeY);
transform.position = new Vector3(posX+offsetX, posY+offsetY, -10);
}
}
As you can understand, gameobject “karakter” is our player that camera should follow. In this script, camera is not smooth correctly. I saw that i needed to use LateUpdate instead of FixedUpdate. I changed it and camera just gone crazy. I mean it was always in a loop in that situation. I only changed Fixed to Late why is this happening? And how can i make the camera movement smooth as i wanted in LateUpdate?