- Home /
How do I smooth out my crouch camera movement
Hi,
I have been working on this silly issue for hours now. Its such a trivial thing but I cant seem to get it to work. I am moving an empty game object - on the Y so my cam follows when I crouch.
The short way would be a bit like this;
cameraHeadHeight = camHeadTransform.position += Vector3.down; camHeadTransform.position = cameraHeadHeight;
Ofcourse I have to use a boolean to make sure it doesnt keep setting the new cameraHeadHeight. That works. But I cant get the lerp to work.
camHeadTransform.position = Vector3.Lerp(camHeadTransform.position, cameraHeadHeight, smooth * Time.deltaTime);
I have tried mathf.Approximately and just doing camHeadTransform.position > cameraHeadHeight, but that never hits, because lerp actually never hits the 'end'.
If I do manage to get the cam do be moved by the lerp, its instant and still clunky.
In a nutshell:
Move GameObject.transform down the Y by 1, in a smooth manner..
Your answer
Follow this Question
Related Questions
Determine transform.position of location between two waypoints on bezier path 0 Answers
Need to check transform.rotation 1 Answer
Learning to move 1 Answer
Mathf.Lerp Question 2 Answers
Smooth swapping my game object 0 Answers