- Home /
Question by
$$anonymous$$ · Jan 25, 2021 at 02:27 AM ·
cameracamera followcamera movement
How would I go about making a camera system for a game akin to the starfighter mode of Battlefront 2?
I'm not quite sure how to describe it, but the ship moves around within its camera's FOV but never out of it. Here's a great example of it:
https://www.youtube.com/watch?v=1-cGSWsZetA
What I don't want (and already have) is a camera so rigid, you can't tell the ship is moving.
Comment
Answer by Llama_w_2Ls · Jan 25, 2021 at 10:39 PM
You could try lerping towards the ship's current position, instead of setting it every Update. This would create a smooth interpolation between the two vectors. For example:
void Update()
{
Vector3 shipPos = Ship.transform.position;
// Set camera pos (smooth)
transform.position = Vector3.Lerp(transform.position, shipPos, Time.deltaTime);
}
@KingT15
Your answer
![](https://koobas.hobune.stream/wayback/20220613023939im_/https://answers.unity.com/themes/thub/images/avi.jpg)