I have encountered a strange issue while working with VR guns. The issue comes about when dealing with weapon recoil. I use Timelines to animate weapon recoil, simply adjusting the X and Z location of the weapons relative location. Using the timeline, it gives a recoil effect. I am using an Attach To Component node to hold the weapons handle on pickup (standard for VR).
Problems arise when I use the 2 handed weapon system I implemented. If you hold the weapon in your right hand (right finger will be firing weapon), and your left hand is on the fore-grip - the weapon will always rotate to point at the second hand, as it would if you were actually holding it.
The problem is once the weapon has rotated using the second hand, the recoil will no longer recoil backward as a normal gun would function. Depending on where you move your hands, the weapon may rotate sideways, diagonal, up or down. Along with this, when you rotate your trigger hand while in 2 handed grip mode, it will affect how the weapon recoils. Firing full auto, if you carefully rotate your grip hand, you can actually watch the weapons recoil change from front to back to side to side.
This doesn’t make any sense to me, as when I print out the relative rotation, location, etc, everything is correct. Since I am adjusting the guns relative location, it makes no sense that the motion controllers rotation has any effect on this. The gun should always have its own relative X, Y and Z axis that changes to where ever it is aimed.
The pictures attached show how the weapon recoil is handled. It is quite simple. The top relative location node is for single handed, the bottom is for 2 handed. Singled handed works fine.
Here is a link to the video where I demonstrate the problem: https://www.youtube.com/watch?v=gCE9…ature=youtu.be
Any help is appreciated.