Getting the rotation axis with respect to the preceding nodes' rotation

Damn. I was just about to post my answer when you solved your own issue. Ah well, I’ll post it anyway for anyone else coming across this problem.

I would say that unless you need your objects to be in relation to something else, you should get into the habit of using global_position/global_rotation over the position/rotation you’re currently using. As the name suggests, these variables provides you with the object’s position/rotation in the global space (just like global_transform does).

Using the global transformation data of a node ensures that the data represents its “true” state.

	# Reference data
	var current_transform = mainCamera.global_transform
	var target_transform = cameraOfInterest.global_transform

	# Computation of new transform data
	var new_position = current_transform.origin.lerp(target_transform.origin, delta * 6)
	var new_basis = current_transform.basis.slerp(target_transform.basis, delta * 6)

	# Assignment of computed data
	mainCamera.global_position = new_position
	mainCamera.global_basis = new_basis

# NOTE: You likely need to adjust the weight-parameter for the rotation.
2 Likes