- Home /
Gun lag behind camera
I know there have been many questions and answers to this but non of them actually achieve what I'm trying to do. How can I make my gun (without animations) to lag behind the camera, like it takes my gun 1 second longer to move to the direction the camera is facing? I have had other scripts that make the gun go ahead of the camera when it moves but not behind it, if anyone can help me out I would be very thankful.
when camera follows the object, camera-controller-script just detects the object's moves and moving towards new position with some speed decreasing (in very-very simple model)
who or what will be speed direction source for camera?
i explain. if player controls object directly from keyboard, how can camera start oving 1 second before user pressed a key.
or explain your question.
Answer by Muuskii · Aug 07, 2012 at 08:04 PM
There are two options:
You could save the camera's position for one second before applying it to the gun
You could use Lerp or SmoothDamp to move the gun's position towards the camera
Which one works for you will depend on your specific situation
Your answer
![](https://koobas.hobune.stream/wayback/20220613075326im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
C# How to have a gun select 1 Answer
FPS Camera moving by my left mouse button 1 Answer
Camera lagging and flipped 0 Answers
More Effective Camera Switching 1 Answer