Question about virtual camera following in 2d.

ok so im probobly an idiot and its staring me in the face but why does this work
CMVcam.transform.LookAt(Sceen);
but this doesnt work
CMVcam.transform.Follow(Sceen);

btw iv called CMvcam1 as a gameobject and Sceen as a transform.
im in 2d space so LookAt just turns the camera and breaks the view so i need follow.

What is Follow? Is that an extension method?

LookAt can be made to work in any space you like. It has a second optional argument that defaults to Vector3.up. In all cases it drives the +Z towards the target.

As always, I recommend Cinemachine for all camera stuff.

ok. whenever i try to use lookat instead of follow to move the camera in 2d space it does this6747115--777856--upload_2021-1-20_20-42-4.png

and im talking about Follow here.
6747115--777859--upload_2021-1-20_20-42-41.png

Do you maybe just need some offset on the TrackedObjectOffset? It’s been a while since I Cinemachined…

well i have 2 objects that i need the camera to follow. when the player moves into a trigger box i need the camera to like. completly follow a diffrent object.

Sounds like a few distinct parts:

  1. get the camera following ONE object reliably

  2. get the camera following a GROUP of objects reliably

  3. change which of the above is running when your condition changes.

Only the 3rd one requires coding, the other 2 are in Cinemachine.

hmm ok ill try that