Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | tomeldee |
Hello!
Can anyone help me please how to get the “local” angular velocity of a rotating RigidBody3D?
It’s rotated like this:
wheelRL.apply_torque(wheelRL.transform.basis.x * engineForce * amount)
I’m trying to get it’s angular velocity like this:
var angVelRL = wheelRL.angular_velocity.x
It’s working in some sense, but as I turn around in the world, the calculated velocity changes based on my heading.
I would need it’s angular velocity regardless, of it’s heading.
Thanks in advance!
Seems like you’d just want its angular_velocity
property, but based on your example code above, I guess that’s not the case?
RigidBody3D — Godot Engine (stable) documentation in English
jgodfrey | 2023-06-07 20:31
yes I want that simply, but it shows correct amount only if I go in +Z direction.
if I go 90 degrees to the left or right it shows sth around zero
if I go in -Z direction it shows the correct amount in negative
I would want it to show simply the angular velocity of the wheel, regardless of the heading of the vehicle.
and I think it should this way…
tomeldee | 2023-06-07 20:36
can it be possible that this way it shows correct values?
var angVelRL = wheelRL.angular_velocity.length()
now it seems to be showing the same amount in every direction… I just don’t know if it’s correct or not
tomeldee | 2023-06-07 21:04