hello everyone i made infinite road . i have character and camera follows him . But i dont want camera to go back . Camera just go +x , not -x . example : □ think , this square is my cam view . □ → and i want camera to go +x . okey ? just +x !!! i dont want -x . How can i do that ? please help me ..... (sory about my english . im not good at english )
Create a script and attach it to the camera object. Make sure the camera object is not a child of the character object. Code (CSharp): public Transform m_Character; void Update () { if (m_Character.position.x > transform.position.x) transform.position = new Vector3 (m_Character.position.x, yPosition, zPosition); } In the inspector, attach your character object to the m_Character variable.