Hello, I’m looking for some help with a widget. Project is in UE4.27.2 with Blueprints.
I want to give players the option of playing in either VR or desktop. I have a 3d widget in the level.
The issue is, for desktop players, they would interact with the widget with their mouse cursor. This requires the “Receive Hardware Input” on the widget is switched on.
For VR players, they would interact with a widget interaction component on their motion controllers. This requires the “Receive Hardware Input” is switched off.
Normally I’d just detect which device they are using and switch the Receive Hardware Input option on or off. But it doesn’t seem to be accessible as a node in Blueprint.
So my question is: does anyone know either a way to switch this on or off (maybe with a console command?) in Blueprint? Or perhaps another workaround for my PC/VR interaction issue?
I found a workaround myself, but posting here in case anyone out there has a similar issue.
Simply created a new Widget Interaction component on the character and set the interaction source to mouse. This creates a line trace from the mouse which can interact with widgets that are not set up to receive hardware inputs.
Okay, suddenly I found a solution just after I posted.
So, it turns out, it does not work when the 3d widget starts with an empty widget class (which was my case). If it starts not emty, and you change the widget later, everything is good.