- Home /
Question by
JayNiize · Apr 12, 2020 at 03:40 PM ·
camera-movementcamera follow
Smooth camera with Player as parent
Hey! i hope i have not missed an answered topic on this problem : i parented my main camera to the player, so i have a third person perspective. The problem is, that the camera is moving immediately with the player. Is there a way to get the camera smooth?
public Transform target;
public float smoothSpeed = 0.125f;
public Vector3 offset;
void FixedUpdate()
{
//Position
Vector3 desiredPos = target.position + offset;
Vector3 smoothedPos = Vector3.Lerp(transform.position, desiredPos, smoothSpeed);
transform.position = smoothedPos;
}
I've already got this script, can i rewrite this code, so i dont have to set the main camera as a child?
Comment
Your answer
Follow this Question
Related Questions
When I lock my camera to my player I saw only my default backround please help me :( 2 Answers
Camera Problems/View,Camera Problem 0 Answers
help! how to set cinemachine freelook velocity. 1 Answer
How to rotate the camera with the player smoothly without the camera snapping back and forth? 2 Answers