[UPDATE 1: WITH THE WORKAROUND/SOLUTION IN THE LAST POST]
[UPDATE 2: Forgot to mention, the problem when this occur is armory3d 0.4alpha with the vehicle from the same release]
I am trying to extend the existing vehicle demo to a more racing car like feel.
But got a strange behavior (this behavior seem to be more visible once change the vehicle shape from default sphere to a custom shape):
On higher speed moving, the vehicle wheels will be moving behind the chassis
I try to tweak the suspension (from 20 to 200), damping (from low value 0.3 to higher value) and other settings, but seem do not make too much differences compare to the original demo
Please see the image below, the vehicle is moving toward right, but the wheels are lagging behind (the higher speed the vehicle, the greater that lag). This problem is not only for speeding forward, but for backward also, as long as speed is building up, the wheel will lag behind the chassis.
According to another StackOverflow thread
The solution mention there is a motion state :
The issue seems to be that the MotionState's callbacks are being called on a different thread to the render function. In Xoppa's sample app (here, for anybody else reading along), the wheel transforms are being updated in the render thread. The fix was to do the wheel transform in the MotionState's callback as well
But I am kind of fail to find how to locate this MotionState Callback in Armory3D Haxe code. Is this a supported feature or it in current Armory, the MotionState will not be supported. If there is other way to resolve the problem, it will also be great.