VR Weapons Kit

Welcome to the VR Weapons kit support thread! Feel free to post questions, issues, or feedback.

The VR kit contains 5 weapons, an inventory, an enemy character and 2 demo levels. Everything in the kit is has been optimised to support Oculus Quest and all weapons have plenty of variables that can be quickly modified (*sound/particle fx, damage/impact force, recoil, mag rounds, etc) *

Available here on the Unreal Engine marketplace

Features list:

Handgun, sub-machine gun, assault rifle, sniper rifle

  • Blend space animation for hand grips
  • Reload magazine and pull back charging handle
  • Single shot/fully auto
  • Grab guns with both hands (reduces recoil)
  • Haptic feedback
  • Sound effects
  • Gun recoil animation
  • Muzzle flash and bullet casing particles
  • Physics impulse on shot objects
  • Silencers
  • Bi-pod and telescopic sight (sniper rifle)
  • Red dot sight (assault rifle)
  • Inventory UI
  • PBR materials and 4K textures
  • Master Blueprint for gun and magazine actors

Flashbang

  • Adjustable range
  • Line trace system to check if player/AI can see/hear flashbang
  • Explosion effect (flash & smoke) and explosion mark decal
  • Flash blindness effect
  • Sound effects (bang and ear ringing)
  • Haptic feedback
  • Removable pin
  • Safety lever animation
  • Radial physics impulse on nearby objects

Enemy character:

  • Health system
  • Physical reaction when shot at
  • Limb dismemberment
  • Reaction to flashbang
  • Detect and chases player
  • Shoots at player and causes damage

Documentation available here

Tested on HTC Vive and Oculus Quest

4.25 Update 14/11/20
Collision for guns - improved
AI throws weapon too far on death – improved
Unnecessary gun mesh sockets - removed
Charging handle haptic feedback stops unexpectedly when overlapping handguard – fixed
Enemy dead bodies “jump” when flashbanged – fixed
Grey seam lines on handgun mesh - fixed
Variable for ejector/bolt animation distance – added
Documentation for creating new weapons - added

4.26 now available 11/01/21

I’m unable to move the player or use the controllers while using the Oculus Quest 1 headset. I did everything that is in the troubleshooting documentation. Please, can you help me get this working?

Which map are you experiencing this with? Could you try pressing the build button for the level you’re on to build the navigation paths and also restart the Oculus Quest headset and go into settings to recalibrate the guardian/floor level. Also please check that tracking is enabled in the Oculus Quest device settings.

When you try to teleport does it show the small stub line indicating that teleportation failed or are the controllers not receiving any input at all?

I tried it on both the quickdemo and the fulldemo maps. I pressed the build and checked all of those settings on the device but it is still not working properly. I’m not receiving any input at all from the controllers. I am also getting the following errors when I load up the project…

Failed to load /Script/OculusHMD.OculusFunctionLibrary Referenced by K2Node_CallFunction_76
Failed to load /Script/OculusHMD.Default__OculusFunctionLibrary Referenced by K2Node_CallFunction_76
Failed to load /Script/OculusHMD.OculusFunctionLibrary Referenced by K2Node_CallFunction_75
Failed to load /Script/OculusHMD.Default__OculusFunctionLibrary Referenced by K2Node_CallFunction_75
Failed to load /Script/OculusHMD.OculusFunctionLibrary Referenced by K2Node_CallFunction_24
Failed to load /Script/OculusHMD.Default__OculusFunctionLibrary Referenced by K2Node_CallFunction_24

Please can you check the Oculus VR Plugin is enabled?

Yes the Oculus VR Plugin was already enabled.

Which version of 4.25 are you using?

I first had 4.25.3 when i downloaded the kit but I upgraded to 4.25.4 but still same issue.

Please can you test this on your Quest and tell me if you get the same result: VR_weapons

I’m using a Mac. Also I am not sure how to test this file. Can you give me an idea on how to test this file on the Quest.

On a Mac you will have to use software like SideQuest to install the APK on your Quest. I assume at the moment you’re testing by launching the game to the Quest from within Unreal and are not experiencing any issues when using Epic’s VR template?

I installed the apk you sent using Sidequest but it’s just a black screen that doesn’t load up. Also, yes, I am testing by launching the game to the Quest from within Unreal, and am not experiencing any issues when using Epic’s VR template.

Okay. Please can you try selecting the Motion Controller Pawn in the level, go to the details panel, scroll down to Input and set Auto Receive Input to Player 0
Auto input.PNG

If this does not work please can you go to the Content Browser > Add New > Add Feature or Content Pack and add the Virtual Reality pack to the project. Then swap the motion controller pawn in the level for the VR template pawn and set it to Auto Possess player 0. If you can let me know whether this works it will help me determine whether it’s the Weapons Kit content or project settings causing the problem for you.

Okay when I tried the 1st step:
Selecting the Motion Controller Pawn in the level, go to the details panel, scroll down to Input and set Auto Receive Input to Player 0…
…Nothing changed

But When I tried the 2nd step:
Adding the Virtual Reality pack to the project and set auto possess player 0…
I was able to see and control the players hands. I could also teleport to another location. Also the height was adjusted properly.
I could also knock the yellow cubes with my hands.

But, I still cannot grip the guns, cartridge, or cubes with the grip buttons.

This is expected as the VR template pawn will be using a different version of the PickUpActorInterface. What I wanted to test was whether it was the project settings or the project content causing the input issue. If the VR template pawn is receiving input and letting you move around then it sounds like it’s the VR weapons kit pawn or motion controllers that are causing the problem.

If you open up the MotionControllerPawn and BP_MotionController from the VR weapons kit, then hit Compile - are you receiving any errors inside these blueprints?

The BP_MotionController has has no errors after compilation.

The MotionControllerPawn has these errors after compiling…

Please can you click on Set Color Scale and Offset to open that part of the blueprint, then right-click the Set Color Scale and Offset node and click refresh nodes.
refresh node.PNG
This should remove pins that no longer exist on that node.

Then recompile the blueprint and hopefully you should get no compiler errors, if this node is still causing errors just delete it temporarily, recompile then test on your Oculus again to see if the input is now working

I did that and the only error that is showing up now is…
Could not find the function ‘CheckDevice’ called from Check Device

I am able to pick up some of the guns, reload, and fire them.
The issue i have now is that i cannot pull the slide for the handgun or the sniper rifle in order to fire them.
I am able to pull the slide for the other guns.

Also, it doesn’t seem that the hand animation is updated properly as im seeing both versions of the hand at the same time when i grip and ungrip.

Hmmm okay. It sounds like there’s a bigger issue going on here. You shouldn’t be getting errors with the Set Color Scale Offset node if you have the OculusVR plugin enabled. I see in the first screenshot you posted you’re getting errors when trying to load the OculusFunctionLibrary, most of these problems seem to be caused by the OculusVR plugin - please can you right-click and search in the blueprint for the Oculus Library, let me know if you get any options like these:
Oculus library.PNG
For the gun reloading issues - please can you try to compile BP_Sniper and BP_Handgun, these both have additional code added for reloading so there may be errors inside these blueprints preventing you from pulling back the bolt/slide

Also go to Pawn>Mannequin>Animations and open RightHand_AnimBP, compile it and check for errors as this blueprint handles switching the blendspace animations for the hand

When I right click on the blueprint I don’t get any options for the occulus library.

Although I do have the Oculus VR plugin enabled from the start. I even unchecked and checked it back again and restarted the editor.

Also both of the gun blueprints and animation blueprints compiled with no errors.

Also when i use the DEBUG handgun i see that it says ‘weapon pick up=false’ while i try to pull the slide while holding the gun.
Maybe the Oculus VR plugin is not really being installed somehow, even though it is enabled?