I migrated my VR project from UE4.26 to UE5 and I noticed I’m unable to “release” the grab. For testing I bound my mouse left and right click to grab left and grab right and in that case the grab detected both the press and release. But when I try to grab with the motion controllers, release is never fired.
I tried re-making my input bindings but that didn’t seem to make a difference, this is what my input bindings look like at the moment. Any idea why release is not triggering with the motion controllers?
Here is my code for binding the Actions/Axis:
void APlayerCharacter::SetupPlayerInputComponent(UInputComponent* playerInputComponent)
{
//Setup game play key bindings
Super::SetupPlayerInputComponent(playerInputComponent);
//Player Jump.
playerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump);
playerInputComponent->BindAction("Jump", IE_Released, this, &ACharacter::StopJumping);
//Grab and Release: Left Hand
playerInputComponent->BindAction("GrabWithLeftHand", IE_Pressed, this, &APlayerCharacter::OnLeftTriggerPress);
playerInputComponent->BindAction("GrabWithLeftHand", IE_Released, this, &APlayerCharacter::OnLeftTriggerRelease);
//Grab and Release: Right Hand
playerInputComponent->BindAction("GrabWithRightHand", IE_Pressed, this, &APlayerCharacter::OnRightTriggerPress);
playerInputComponent->BindAction("GrabWithRightHand", IE_Released, this, &APlayerCharacter::OnRightTriggerRelease);
//Use Item: Left Hand
playerInputComponent->BindAction("UseItemLeftHand", IE_Pressed, this, &APlayerCharacter::OnLeftTriggerPress);
//Use Item: Right Hand
playerInputComponent->BindAction("UseItemRightHand", IE_Pressed, this, &APlayerCharacter::OnRightTriggerPress);
//Equip Item: Left Hand
playerInputComponent->BindAction("EquipItemLeftHand", IE_Pressed, this, &APlayerCharacter::OnEquipLeftHandItem);
//Equip Item: Right Hand
playerInputComponent->BindAction("EquipItemRightHand", IE_Pressed, this, &APlayerCharacter::OnEquipRightHandItem);
////Crush Item: Left Hand
//playerInputComponent->BindAction("CrushItemLeftHand", IE_Pressed, this, &APlayerCharacter::OnLeftGripPress);
//playerInputComponent->BindAction("CrushItemLeftHand", IE_Released, this, &APlayerCharacter::OnLeftGripRelease);
////Crush Item: Right Hand
//playerInputComponent->BindAction("CrushItemRightHand", IE_Pressed, this, &APlayerCharacter::OnRightGripPress);
//playerInputComponent->BindAction("CrushItemRightHand", IE_Released, this, &APlayerCharacter::OnRightGripRelease);
//Reset VR View
playerInputComponent->BindAction("ResetVR", IE_Pressed, this, &APlayerCharacter::OnResetVR);
//Player Sprint
playerInputComponent->BindAction("PlayerSprint", IE_Pressed, this, &APlayerCharacter::OnSprintPress);
playerInputComponent->BindAction("PlayerSprint", IE_Released, this, &APlayerCharacter::OnSprintRelease);
//Player Movement Forward/Backward
playerInputComponent->BindAxis("MoveForward_Y", this, &APlayerCharacter::MoveForward);
playerInputComponent->BindAxis("MoveBackward_Y", this, &APlayerCharacter::MoveBackward);
playerInputComponent->BindAxis("MoveRight_X", this, &APlayerCharacter::MoveRight);
playerInputComponent->BindAxis("MoveLeft_X", this, &APlayerCharacter::MoveLeft);
}