I’m trying to build an RC-like car in Unreal Engine, one gear with a flat torque curve and instant max rpm. (Similar to how an electric engine works) Audio pitch modulation of the engine is usually tied to the RPM, since mine is either at “0” or at “MAX”. Can I use something like the wheel rotation to control the pitch?
Using the regular vehicle movement works but I want the audio pitch to react to any potential wheel spin either by loss of friction / drifting or jumping. Can I do this somehow or should I rebuild my vehicle controller and go back to using gears and a more normal torque curve?
If the wheel is actually spinning, then you would want to track the delta on the rotation over time.
Just get a reference to the wheel, and every frame compare its current position to the last position to find your angle of rotation, then divide that by the time since the last frame (world delta).
The only thing to keep in mind is that your sample rate of your angle checks may be too slow:
So you might be better off simply detecting if the car is in the air or not rather than trying to determine if the wheels are spinning faster or slower when it goes in the air.
Just get a reference to the wheel, and every frame compare its current position to the last position to find your angle of rotation, then divide that by the time since the last frame (world delta).