The problem is the terrain rotation, it can have rotation (90 f,90 f,180f). The camera should work as a local child object. The camera must understand by local coordinates where which side is . I tried as you advised, but when moving the camera twitches and moving around the sides works poorly.