FreeCamera-UniversalCamera FPS movement behaviour

Hi guys I just wanted to know how do you achieve the universal camera behaviour shown on this examples :
Babylon.js - The Car demo
Babylon.js - Heart demo
you know , like a first person shooter experience , you have the Y coordinate of the universal camera locked on the “player” specific height no matter what, and you cant cross the walls with the camera. I really have no idea how to do this, i mean i know you gotta play with the camera inputs but im just lost. if you can explain the limits of the camera movement when it encounters a wall that would be deeply aprecciated too , overall i would like to achieve the camera behaviour of those 2 examples, its a shame that most demos dont have the code for you to go through. or at least i dont know where that is. thanks in advance guys.

sorry guys nevermind I found the playground example: https://playground.babylonjs.com/#CTCSWQ#945 and now I know that it wasnt achieved manipulating the camera inputs to lock the Y coordinate everytime you move forward, backwards or sideways but by affecting the camera with gravity and collisions so you can’t just float your way trought the entire space