Widget change receive hardware input

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?

https://imgur.com/a/IRVtl12

2 Likes

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.

2 Likes

Thanking you from the future, this is exactly what I needed to get on track.

For some reason, this only worked when I “faked” the click, the same way we do for our other interaction components: