Topic was automatically imported from the old Question2Answer platform.
Asked By
socterean
Hello everyone!
I want to get the rotation speed (RPM) of the Vehicle Wheel node for one of my projects. But I couldn’t find any good information on how I can achieve that.
To be more specific, I have a car and I want to see how fast a given wheel is rotating when I am driving around.
What type of Node is the Wheel? If it is a RigidBody. You can use:
get_angular_velocity()
to access the rotation speed and
set_angular_velocity(value) to change it
Thank you for your answer, unfortunately the node is an actual VehicleWheel node and I think that it does not have access to the RigidBody member functions as I can see from the documentation, I was hoping to find some indirect way to determine or simulate the rotation speed. But now if I think about it I believe that I can calculate the supposed rotation from the actual speed of the car in relation with the wheel’s radius.
I see, unfortunately i have never used Vehiclewheel node so can’t help you there at the moment. I may look into it some time in the future, though I can’t make any promises.
I have found the solution and I will let it here for the people who might need it. As I have found out I think that the Vehicle Wheel Node doesn’t actually rotate, but the supposed RPM that it should have can still be calculated as follows:
revolutions per minute (RPM) = speed in meters per minute / circumference of the wheel in meters
and
circumference of the wheel = radius * PI (aprox 3.14) * 2