How to Flycam get "stuck" in the Y coordinate, and can only move sideways, but unable to move up and down

Hello, I am creating a basketball simulator which is basically a scenario and click the right mouse button you throw the ball, which must be set for the rim. My goal is maximum realism, so that players can train their physical and spatial sense playing this game. I’ve done all the calculations, defined a friction for the ball, I calculated the distance from her, How much it bounces etc, increased physical precision etc … Now, to simulate the vision of a basketball player of average height, need the camera to be “locked” in the Y coordinate, it can move freely sideways but can not fly up or down, know what I mean. Give me a hand!

Just attach the camera to your player and make sure that the player can’t move in y direction (for example using physics). You’ll probably also want to disable the default flyCam mappings.

or just set the cameras Y in update every update

Thanks! It helped me a lot!