Are you trying to make a 3D camera that will follow an object (like the player) but allow free rotation without the rotation of the object affecting it? If so, what I would recommend doing is having the Camera (and it's node) completely separate from the scene that contains the Player and then have the camera follow the character via code.
Something like this (untested, but I've used code similar many times):
# camera controller script
# Assumed tree structure:
# controller (script attached to this)
# -- Spatial (for rotation on one or more axes)
# -- -- Camera
#
# The rotation node needs to be at origin (0, 0, 0) relative to the instanced scene
# but the camera needs to have an offset on the Z axis, so when the camera rotation
# node rotates the camera will orbit the target node
extends Spatial
var camera_node : Camera
var camera_rotation : Spatial
# You will need to set this in the editor by clicking the node after creating the script. In the inspector you should be able to set it
export (NodePath) var path_to_target = null
# If doing it through code, just set target_node directly
var target_node : Spatial
func _ready():
if (path_to_target != null):
target_node = get_node(path_to_target)
func _process(delta):
# Rotate camera rotation node here or in _input! I'll leave the code out for this example
if (target_node != null):
global_transform.origin = target_node
Then all you need to do is set it to the node you want to follow, and it should work. If the target node rotates it will stay in place, but you can rotate it yourself.
If you want, I can see about making a quick minimum example project when I have some spare time, just let me know if it would help :smile: