Still no luck. I tried totally recreating the entire SprungWheel apparatus and my tank is still not falling.
A) When testing with Physics Constraints, I found that the cube won’t fall if the other cube on the physics constraint is missing.
B) I added additional logging to verify that the GetAttachParent() is able to find the tank, and that the BodyRoot variable we created is able to find the body root before attaching it to the physics constraint.
Proof:
C) When I select the SprungWheel blueprint object while the game is running, I don’t see that it has any attachments! Manually setting these attachments at run time had no impact.
My C++ code matches the code from the git repo, except with extra log lines added. I am using UE v4.19.2.
Has anyone gotten this to work? When you depossess do you see that it has the constraint actors 1 and 2 properly set?
void ASprungWheelRM::SetupConstraint()
{
if (!GetAttachParentActor()) return;
UPrimitiveComponent* BodyRoot = Cast<UPrimitiveComponent>(GetAttachParentActor()->GetRootComponent());
if (!BodyRoot)
{
UE_LOG(LogTemp, Warning, TEXT("(RM) No body root!"));
return;
}
else
{
UE_LOG(LogTemp, Warning, TEXT("(RM) Body root found"));
}
MassWheelConstraint->SetConstrainedComponents(BodyRoot, NAME_None, Wheel, NAME_None);
}