Physics constraint "No joint created" warning only on first play?

I have C++ code that inherits AActor and:

  • In the constructor:
    • creates the static mesh components
    • sets up attachments
    • creates the physics constraint component
  • Then in BeginPlay:
    • connects the physics constraint to the 2 static mesh components.

When I open UE5.1 and immediately hit play, I get “attempting to create a joint between objects that are both static. No joint created.” and the joints are all wonky (still kind of connected but clearly messed up). However, if I inspect the BP actors that use the C++ code before hitting play, or I hit play again (after once getting the warning) everything works fine, connections are made and everything works.

What is happening? Does something need to be moved into or out of BeginPlay?

I Had the same issue, but the joints are working fine, despite the warning.
I suspect it is related to the order of subcomponents registering.
Moving the SetConstrainedComponents() to inside beginplay() solves the warning.

Ok, I have a workaround for this.
Instead of this declaration:

joint->SetConstrainedComponents( link_A, FName(link_A->GetName()), link_B, FName(link_B->GetName()) );
I did this way, and seems to solve for me.
joint->ComponentName1.ComponentName = link_A->GetFName();
joint->ComponentName2.ComponentName = link_B->GetFName();

I think that the issue is related to component initialization or registration throughout API runtime. I am surprised by the lack of documentation, it would be awesome to have something like a user-collaborated wiki for UE api.