VR Expansion Plugin

Hey, hope you don’t mind giving me a hand again. I’ve tried to sort out myself for a couple days and I’m running into a wall with the slotting system. Here’s my setup in C++:


IVRGripInterface* GripInterfaceForActor = Cast<IVRGripInterface>(HitResult.GetActor());

if (GripInterfaceForActor)
{
bool bHadSlotInRangeLocal = true;
FTransform SlotTransform;
FTransform HitActorTransform = HitActor->GetActorTransform();
GripInterfaceForComp->Execute_ClosestGripSlotInRange(HitActor, RightMotionControllerLocation, false, bHadSlotInRangeLocal, SlotTransform, RightMotionController, NAME_None);

FTransform TransformForHadSlot = HitActorTransform.GetRelativeTransform(SlotTransform);
FTransform TransformForNoSlot = RightMotionController->ConvertToControllerRelativeTransform(HitActorTransform);

FTransform FinalTransform;
if (bHadSlotInRangeLocal)
{
UE_LOG(LogTemp, Warning, TEXT("Had slot in range"))
FinalTransform = TransformForHadSlot;
}

if (!bHadSlotInRangeLocal)
{
UE_LOG(LogTemp, Warning, TEXT("Didn't have slot in range"))
FinalTransform = TransformForNoSlot;
}

// FTransform CompTransform = HitResult.GetComponent()->GetComponentTransform();
RightMotionController->GripObjectByInterface(HitResult.GetComponent(), FinalTransform, false);

**The problem is that when I grip with code, the object jumps/snaps *towards *my controller for a split second, then flies away a few meters with physics instead of snapping to my hand. **I have a VRGripP1 socket set up on the grippable static mesh, and it’s inside a BP based on the GrippableActor class. I wanted to figure out myself but I thought you might be able to quickly spot my mistake. Thank you!