When I launch editor with more than 2 Vive trackers, it crashes.
Debugging led me to the SlateApplication.cpp@5852 and SteamVRController.cpp@366, which gets Invalid as type of game pad key (button?) for the tracker. It seems that it reads wrong values from VR saying that some tracker buttons those have been pressed being released while type of the button is unknown. It seems that it tries to handle trackers as controllers, and attaches them to hands prior to real controllers.
It seems to be fine if I start editor with only 2 motion controllers enabled, then enable trackers one by one.
I’m running into the same problem (UE 4.17.2) - although for me it is impossible to get it to work. Regardless of how or in what order I enable my motion controllers and trackers.
I have looked at the code and I am unable to find a way how this can work in the first place (which makes me wonder if this code was even tested).
Anyway, what happens is that in FSteamVRController::SendControllerEvents all the SteamVR buttons get polled and when a button press is detected the following code gets called:
FKey::isValid then checks the passed KeyName argument against button names listed in InputCoreTypes.cpp. Unfortunately InputCoreTypes.cpp does not have a key named “Steam_Generic_Trigger” and UE crashes because of call being made on a null pointer.
Yep this is exactly the conclusion I came too. And is still an issue in 4.18. It’s a little over my skills to dig in and fix this but I did hack it by modifying SteamVRController.cpp and changing the key name to another gamepad input for Special_1 controller. It works for my case until epic has a better solution. No more crashes at least and the button fires an event.
Hey there,
i ran into the same problem in engine version 17.2/18.2. Since i dont feel very comfortabel in scripting, i would really appreciate a less cryptic description of your solution. Maybe you can just share your SteamVRController file or at least the lines you changed.
cheers!
I just manage to fix this crash, but for some reason the PPGun that I am using also opens the Steam overlay anytime I press the trigger. I will be updating the code to a fork of Unreal Engine at the github of VRMonkey, I will let you guys know when I do it.
I’ve added these lines around line 240 of steamvrcontroller.cpp. Again this maps the first detected vive tracker to gamepad events. I then setup the gamepad d pad events in blueprint to fire off code when the trackers are used as input.
@Pekayatt: Have you managed to implement this change yet? also can you explain a little on how you fixed the crash? I am getting the same issue when i send trigger values/presses through tracker USB to UE4 4.18.0.
See TheFoyer’s answer above. UE doesn’t support input events from Vive Trackers, so they cause crash. Still no fix in 4.19, so i’ll try add a new bug report via new form
File to edit:
[Engine/Plugins/Runtime/Steam/SteamVR/Source/SteamVRController/Private/SteamVRController.cpp] file.
Add this lines after line 237 (within the for() loop):
Thanks @ , I should have mentioned that I have set up the tracker as a controller using the role changer program from HTC, I upgraded to 4.18.2 this morning and the crashes stopped