Download

Motion controller "release actor" bugfix instructions (+ fix w/ controller rumble).

I came across an easily encountered bug when expanding from the 4.13 VR template, and I hope the solution is helpful to other devs. When a BP_PickupCube is destroyed (for example a subclassed actor that can be shot or one that breaks on collision with the world) while being held, the hand is stuck in the “grab” state until you grab another one.

An easy way to test this is to add a trigger that destroys BP_PickupCubes like this:

http://angelmapper.com/gamedev/ue4/img/VRUngrabBug.jpg

Grabbing a cube and moving it into the trigger will destroy the cube and leave your hand in the “grabbed” state even if you release/press the trigger again.

A simple fix is to add a connection to the BP_MotionController’s ReleaseActor function:

http://angelmapper.com/gamedev/ue4/img/VRUngrabFixOption.jpg

A slightly more complex fix that uses the controller rumble functionality when the cube is destroyed is to add this section to the main Event Graph of the BP_MotionController blueprint:

http://angelmapper.com/gamedev/ue4/img/VRUngrabFixOptionRumble.jpg

Again, I hope someone else finds this useful so you don’t need to waste time tracking it down. Thank you!

it’s didnt work,still has the bug

it’s didnt work,still has the bug

Untested in 4.14 if that’s where you’re trying it. Which fix did you try and how are you destroying the cube?