Help with camera movement

I’m trying to make a camera that stays on an axis but follows players’ movements.

I can do set camera movement, but only in one place.

Here is an example by @Nullxiety

Check this out it might help. How would I make a custom character follow the camera on the X axis? - #15 by LightningLion58

You will likely need the Scriptable CameraType.

I have checked both of those, but none of them give me an answer

Here is another example of what I mean:

cred: @Nullxiety