The unary negation operator -
is always applied left-most -camera.basis.z
.
Your camera may have a different transform than the characterbody, if you only rotate the camera then yes use camera.basis
, but if you use a parent rotation as part of the camera you might need to use the global transform instead through camera.global_basis
. For example most first-person controllers rotate the characterbody around the y axis, and rotate the child camera around the x axis. However most first person controllers only want x-z planar movement, so the camera’s rotation should not be considered, which brings us back to using -basis.z