Applying torque causes set_axis_angle normalized error

Godot Version

4.2

Question

I tried to normalize the torque but that didn’t work. It shouldn’t cause issues right? Why would apply_torque even cause set_axis_angle errors? I have made sure that this snipped is the cause. Commenting it out fixes the errors.

A set_linear_velocity(Vector3.ZERO)
set_angular_velocity(Vector3.ZERO)
apply_central_force((controller.global_position - global_position) / (delta*delta) * mass)
var torque = (controller.global_basis * global_transform.basis.inverse()).get_euler() / (delta*delta) * inertia
apply_torque(torque)

If I use godot jolt there are no such errors only godot physics gives me errors. The error: E 0:00:01:0003 set_axis_angle: The axis Vector3 must be normalized.
<C++ Error> Condition “!p_axis.is_normalized()” is true.
<C++ Source> core/math/basis.cpp:837 @ set_axis_angle()

Found the error; inertia is somehow getting set to (inf, inf, inf).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.