How to limit camera pitch

Hello, I want to create function to limit camera pitch, but it still not working. Here’s the screenshot.

Here’s the function

My Character is third person that can switch to first person camera view, but I don’t like the camera that can see too high and too low.

Here’s inside the function

Please tell me how I can fix the functions. Thank you very much.

Ok I fix this, for the “cast to player controller”, I should call the pawn, not the casting. Its working now.

you could use player controller or player character as far as Im aware.