Hello !
I want my camera move from his position to the position of a targeted regardless the player’s position.
This is my code :
`
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraMove : MonoBehaviour
{
[SerializeField] Transform targetPoint;
[SerializeField] float smoothSpeed = 0.0001f;
[SerializeField] Vector3 offset;
// Update is called once per frame
void LateUpdate()
{
if (transform.position == targetPoint.position + offset) return;
else
{
transform.position = Vector3.Lerp(transform.position, targetPoint.position + offset, smoothSpeed * Time.deltaTime);
}
}
}
`
My problem is that the speed of the camera is insane. Regardless of the value I put into ‘smoothSpeed’, I always have the camera moving fast and the test case where I check if the position is reached don’t end the process…
Thanks for any suggestions!