Godot Version
4.3 stable
Question
Hi, im trying to rotate a characterbody3D around the x axis based on user input but for some reason its occasionally maxing out at 90 degrees, whereas other times itll work perfectly fine??
this is the code handling the rotation
elif input_dir.y != 0:
rotate_object_local(Vector3.LEFT, 5 * input_dir.y * delta)
this is some other code which i think may be affecting it but i dont know
func slope_align(xform):
if !is_on_floor():
return xform
var before = xform
xform.basis.y = Vector3.UP
xform.basis.x = xform.basis.y.cross(xform.basis.z)
xform.basis = xform.basis.orthonormalized()
var result = before.interpolate_with(xform, 0.1)
return result
else:
var normal = get_floor_normal()
xform.basis.y = normal
xform.basis.x = xform.basis.y.cross(xform.basis.z)
xform.basis = xform.basis.orthonormalized()
return xform
return "woopsies"
sorry if my code looks awful lmao