Free camera - Clamp distance to Player

Hi there,

currently i am working on a free build mode. As I press “B” my camera detaches from the player and can be moved with WASD. While holding the right mouse button you can rotate the camera.
The height (z-coordinate) is clamped between 50 and 2000. The y-rotation is clamped between -60 and 60. Now to the question:

Is there a way to easily clamp the distance between the player and the free camera? So i can orbit around the player but only inside some kind of sphere and without weird movement issues?
I am very familiar with vector calculation so no blueprint path is needed. Just some tips whether there is a certain node for this or how i could realise the movement.

Thx a lot guys!

No, there is no node for that. You can simply limit your movement if goes beyond needed.

Ok, thx my friend

If anybody asks in the future here is my solution but is a bit jerky:

Important: Add branch BEFORE setting world location.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.