- Home /
Is there an easy way to make my camera lag behind the vehicle?
I need my camera attached to the players vehicle lag behind and eventually catch up with it when it moves. Until this point I implemented some arbitrary camera positioning and rotations via calculations based on the mouse position (the mouse position controls the direction of the ship).
I just need to give the camera some inertia and be affected by changes in the ship's path.
Whats the best way to do this?
My vehicle is controlled by some code and cannot be controlled by physics, it does not use the physics engine.
Answer by iagoccampos · Jun 12, 2015 at 02:00 AM
You can use Vector3.Lerp to set the position and make the camera follow some GameObject. Create an empty GameObject child of the car and change his position to the place where de camera would be if the car was stopped. After this create a script for the camera, create a transform variable that will hold the transform of the empty GameObject and make the lerp of the camera.postion to the empty GameObject position.
That's good! I just need to figure out how to handle the camera's orientation. The vehicle must remain in focus during the flight process... I'm really frustrated right now.
Your answer
Follow this Question
Related Questions
simultaneously apply torque around 2 different axes 1 Answer
Jittery Movement - specific mechanics in mind 0 Answers
How to use linecast ?? 1 Answer
Wierd Internal Physics problem 1 Answer