CamFollow for car game (Help)

Hi everyone.

I’m currently working on a racing game and I want a camera better than the “Smooth follow” (doesn’t work well for my game even in the testing phase).

I know exactly what i’m after. I would like it to operate like a boom pole with the car being the center and the camera facing forwards with the car. (like this Imgur: The magic of the Internet)

I’d also like to have some smoothing applied at two different float values, one for the follow and the other for the rotation.

I’m not really sure where to begin with this, other than “find the cars position and rotation” which i’ve done with this:

private GameObject playerCar;
private float playerCarDirection;

void Start()
{
playerCar = GameObject.FindGameObjectWithTag("Player");
}

void Update()
{
playerCarDirection = playerCar.transform.rotation.eulerAngles.y;
}

Any help with getting something smooth and functional working would be greatly appreciated!

Little confused, you say Smooth Follow doesnt work for your game but then you describe what you do want and it sounds exactly like smooth follow?

Try using Cinemachine. It has some cameras that might work better for you. Also, the virtual camera blending functionality is awesome.

You can find it in the Package Manager.

1 Like

Cheers for the responses, as for why i didn’t want to use smooth follow it’s really because I wanted to learn how to do it myself. I find it hard to penetrate pre-written code and find i learn more from doing and then that understanding helps me modify things more.

I’ve gotten this sorted now though, so thanks!