Download

Wheels in C++ not assigning correctly to their bones

Hello everyone.

I have some issue which I initally thought that wasn’t related to C++ code, but now I think it is.

I explained it originally here:

https://forums.unrealengine.com/development-discussion/content-creation/1741753-physics-behavior-in-runtime-not-matching-the-physics-asset

But if you want a summary: I try to use my custom car model in a project based on the Simple Vehicle template. I spent many hours making sure that I did all the 3d / export / import part properly and I’m pretty sure I did. But when I run the game, the actual wheel collisions, the ones being controlled by the keyboard, that steer, have torque, etc, are not aligned to their bones but in the 0,0,0 of the car instead.

Any idea of what to check or try?

Thanks.

A little update: I tried to get every bone postion programatically and use this position as AdditionalOffset, but

GetMesh()->GetSocketTransform(“Whatever_bone_name”).GetLocation()

or

GetMesh()->GetSocketLocation(“Whatever_bone_name”);

always returns (0, 0, 0).

And I checked whether the bones existed with

if (GetMesh()->DoesSocketExist(FName(“Whatever_bone_name”))) {
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(“Whatever_bone_name exists”));
}

and it finds the bone.

Is it possible that the bones still don’t have the postions assigned on the Pawn constructor? I make my calls after all the mesh inzializations, right before the WheelsSetup code.