Godot Version
4.6
Question
Hi,
In my game (3D), I would like to prevent the player from being able to look completely behind them.
The idea would be to limit their field of view to a dynamic angular range based on their forward direction (-transform.basis.z).
Specifically:
I would like to constrain the rotation of the gaze to a range such as:
[180°, -180°]
But relative to the player’s current direction (so not in fixed world space, but rather in local space based on -transform.basis.z).
Basically:
The player’s forward direction defines the center of the field of view
Only a certain arc around this vector is allowed
It is impossible to turn the camera beyond this (so no looking completely behind)
If you have already implemented this kind of constraint properly in Godot (3D), I’m interested.
Thanks!