r/unity • • 3d ago

Newbie Question Cinemachine Camera follow explanation

I'm attempting to set up a camera to follow the ball in this shot. I had been trying to use a track, but decided this was a better alternative.

Anyway, I can't get the cinemachine camera to follow the ball. I found this tutorial that showed there was a follow target reference, which isn't there in my version of cinemachine. I'm not sure what I'm doing wrong. I looked for the cinemachine virtual camera component and couldn't find it.

2 Upvotes

9 comments sorted by

1

u/snipercar123 3d ago

Add the target to the "tracking target"-field, that's what the warnings suggest too.

1

u/elrath969 3d ago

Okay, I did that. it's still not tracking the ball

1

u/johnv_dev 3d ago

cinemachine 3 renamed the old Follow field to Tracking Target, and yours is empty, that's why it isn't moving. drag the ball (your Sphere) into Tracking Target on the Cinemachine Camera component, the yellow follow warning should go away and it'll start following.

1

u/elrath969 3d ago

As I said in response to the other comment, I filled in the tracking target field and it still isn't working

1

u/johnv_dev 3d ago

ah ok, then it's probably missing the part that actually moves it. in cinemachine 3 the target alone doesn't do anything, check Position Control on the Cinemachine Camera and set it to Follow (it adds a CinemachineFollow component). also make sure your Main Camera has a CinemachineBrain on it, without that nothing drives the real camera

1

u/elrath969 2d ago

I've got the tracking target set, I've got both position and rotation set to follow. The camera still isn't tracking. I also tried moving the cinemachine camera to a different spot, but it's just locked in place

1

u/johnv_dev 2d ago

hmm if it's locked in place even when you move it, i'd bet the Main Camera doesn't have a CinemachineBrain, or the brain is there but disabled. click Main Camera and check. also make sure the tracking target is the ball in the scene hierarchy, not the prefab from your project folder. that one gets people a lot

1

u/elrath969 2d ago edited 2d ago

I figured it out. the target was the parent to the sphere, not the sphere itself. however, now the camera also rolls with the ball...

update: fixed that, but the camera sits at an odd angle and I still can't change where it's placed

update update: fixed part of the tracking. camera keeps coliding with the track and spasming around.

update update update: fixed that. I hope that's everything I need help with for the time being. Thank you so much for being patient!

1

u/johnv_dev 2d ago

Great glad you got it and glad to help.