Assuming you’re using an AStaticMeshActor. If not, do GetBodyInstance()
on your component of choice. Regardless, not sure if this will work, but give it a try anyways:
if (FBodyInstance* BodyInstance = GetStaticMeshComponent()->GetBodyInstance())
{
if (FPhysicsActorHandle ActorHandle = BodyInstance->ActorHandle)
{
if (Chaos::FGeometryParticleHandle* ParticleHandle = ActorHandle->GetHandle_LowLevel())
{
BodyInstance->bLockRotation = false;
ParticleHandle->SetR(Rotation);
BodyInstance->bLockRotation = true;
}
}
}
Let me know.