Implementing Reload with Motion Controller

Hello,

I need help. Again!!!

I am working on a shooter in VR and I need to implement Reload functionality with motion controllers something like swing your gun to reload (gunstringer kinect style). I am doing it by getting linear velocity of mesh attached to motion controller and checking change in velocity with previous velocity but its not working fine.

Can anyone help me out please.

Are you doing this in blueprint or C++? If you’re using the node “Get Velocity”, it returns the relative velocity of the components’ parent. Which in this case would be 0 since the motioncontroller and the mesh is both moving at the same velocity. Try this out:

AverageVelocity = DeltaLocation/DeltaTime

Record previous location at the end of tick, on new tick you subtract current location from it and divide it by delta seconds = velocity

There is also a good plugin called “Gesture Tracker VR”, but what I mentioned above is probably easier to implement. Good luck!