[C++/VR] Prevent clipping on pick up object

As I understand it, physics constraints are the ideal way to attach a pick-up to a VR controller (Actor) while retaining the inability for the player to make the picked up object from clipping through walls. However when I try to set a constraint to the controller actor, the mesh will not move at all with the controller.

Current code/setup is as follows:

AStaticMeshActor with UPhysicsConstraintComponent and PickUpAble Tag

AVRController Class derived from AActor

I have tried reversing the Actors in the SetConstrainedComponents and the behavior is the same.

void AVRController::Grab()
{
if (m_b_can_pick_up == true)
{
	if (m_pick_up_actor != nullptr)
	{
	// Works but clips thorough objects. See below video
	//m_pick_up_actor->GetStaticMeshComponent()->SetSimulatePhysics(false);
	//m_pick_up_actor->K2_AttachToActor(this, TEXT("Trigger"), EAttachmentRule::KeepWorld, EAttachmentRule::KeepWorld, EAttachmentRule::KeepWorld, false);

	UPrimitiveComponent* pick_up_actor_cast = Cast<UPrimitiveComponent>(m_pick_up_actor);
	m_pick_up_actor->m_phys_constraint->SetConstrainedComponents(m_vr_controller_mesh, NAME_None, pick_up_actor_cast, NAME_None);
	}
}
}

Here is a video of the not desired output

After a day of testing and looking at other people’s code I was able to get the desired effect.

I needed to constrain the two static meshes with
m_pick_up_actor->m_phys_constraint->SetConstrainedComponents(m_vr_controller_mesh, NAME_None, m_pick_up_actor->GetStaticMeshComponent(), NAME_None);

I also had to set the following properties on the constraint
Stiffness 5000
Damping 500
Contact 10
LinearBreakThreshold 5000000

I also had to disable and enable the LinearBreakThreshold when teleporting.
Here is a video of how it looks

Can you post a code snippet of that? I don’t see how you set those parameters on the constraint. Is that the constraintInstance? I don’t see those parameters on the contraintinstance either…