I have a car which works REALLY well with dynamically exchangeable parts like roofs, hoods, lights, safety frames, turrets and so on. However I found wheels are quite a different thing.
If I have the wheels’ geometry included within my main car skeletal mesh, everything’s dandy.
As soon as I remove the wheel geometry and try to include wheels as static mesh children on the main skeletal mesh (obviously hanging them on correct wheel sockets), the whole thing is becoming as stiff as stiff gets. The suspension doesn’t work at all, wheels don’t turn anymore… even though:
1, I created bogus wheel bodies in PhAT
2, I have the anim BP correctly set up
3, the tire type has been set up accordingly
4, the wheel static mesh has its collision set up correctly
Is it a requirement for the Wheeled Vehicle to have the wheel geometry included inside the main skeletal mesh for things to work correctly ?
Are there workarounds ?
Did I miss anything ?
Is there an article / tutorial that explains how things work in a Wheeled Vehicle ? ( I mean in-depth explanation rather than the normal tutorial which doesn’t tell you anything except “do this, do that, then it works” )
I’m working on the same. If the issue still has not resolved for you, we could exchange notes, so to speak.
What I’m doing, is:
In PhAT: Remove any bodies from the “wheels” (which are just joints without a visible mesh) - the physics engine creates the necessary collision body from radius+width in the wheel data.
Add 4 StaticMeshComponents to my vehicle BP and attach them to sockets on the wheel joints via AttachToComponent.
Set collision for the above components to none (not sure if that is required, but collision issues might occur otherwise and as stated above, collisions are not needed).
In construction or on input I set a new mesh for the StaticMeshComponents.
Make sure you are using the correct joint names in your vehicle’s movement component’s wheel setup.
Check if the correct Anim Blueprint is set in the mesh’s settings and that it has been created specifically for this skeleton AND with VehicleAnimInstance as parent.
Anim graph has to have Mesh Ref Pose and Wheel Handler connected to Final Animation Pose.
If you have additional nodes connected (LookAt or Transform Bone), deactivate them temporarily.
The wheel joints need their pivots to be aligned with the car.
What I’m still trying to figure out, is changing the wheel data in runtime (e.g. wheel radius, friction etc.). I resorted to C++ for that and know what properties to change, but not yet exactly how to apply them.