i want the camera to follow player forward only and not backward in unity2d

i am making a 2d game and i want the camera to move in the player positive x axis position only (to follow him forwards only) i saw a post asking the same question but it didn’t work

Are you using Cinemachine? Maybe its possible with it.

If you dont use it, maybe you could use an “if” to just move the cam when it should be moving right. Something like:

movement = new vector3(moveHori, moveVerti, 0);

if (movement.x >= 0) {
transform.position = movement ;
} else {
// dont move 
}