Still broken on UE 4.18.
Yes, please!
I’m also looking for any temporary solution or workaround to get this functional in my project.
I’m experiencing same problem on UE4.18
Bump.
In Multiplayer VR we have not other systems… client fires up hovered, but click events won’t fires. We need this in MultiplayerVR.
any progress on this Rudy its still broken in 4.18
please reopen this or i will have to hirer a coder to make a version that works
UE4.19 - Multiplayer VR, menu system:
1 – Bug with Click –
Description: click is not triggered on any client when more then one client is present in game
[WORKS] when testing in multiplayer environment with one dedicated machine for dedicated server and one dedicated machine for a client
[DOESN’T WORK] when launching a second client
Note: if one client leaves game and remains just another one client, CLICK starts working properly
Hack/Workaround:
Fortunately HoveredOn/Off functionality is triggered, so I know which widget is currently hoveredOn.
I trigger “click” functionality directly from controller, without relying on “mouse left click”,
and do stuff related to widget.
Unfortunately: HoveredOn/Off functionality stops working normally if more than one client is connected to game.
2 – Bug with HoveredOn/Off –
Description: HoveredOn and HoveredOff events are triggered one after another on each Tick, when more than one client is connected to server, even when cursor doesn’t move and is always on button.
So HoveredOn basically works like “OnColliding”.
good news is that at least HoveredOn starts being triggered on hover-on and stops being triggered on hover-off.
bad news is that you really never know when hover-off happens, since HoveredOff is also triggered on every tick right after HoveredOn.
So I defined true HoveredOff event.
Hack/Workaround:
I have set parent actor of this widget to check on each Tick if HoveredOn has been triggered.
If HoveredOn is not triggerd for one Tick, on second Tick I know for sure that we have a true HoveredOff event.
cons of this solution is that I lose one Tick, but this is not crucial for me, since this is just a menu system with buttons.
In addition, to cover loosing of “One Tick”, I could be using a preventive approach and calculating stuff on each tick, one tick before “True HoveredOff” event, and then applying calculations.
check out my answer, it might help you
Bug present in 4.19.
I gave my solution as an answer here.
Finally has not effective solution, I did a SET CUSTOM HIT. Now all works, hover and click. But if you let Widget Interaction as Mouse, in multiplayer setups not work any second CLICK or HOVER. first always will do hovered or click, but if you changed to another widget ( widget index or try to click in other button, system stop work, hovered or clicked)
I recommend to everyone to create a CUSTOM HIT, is relatively simple, only shot a trace from motioncontroller to forward vector + units as you like trace lenght, set HIT result as SET CUSTOM HIT, and set widget interaction mode as custom.
Of course, all of this in VR, in Desktop Mode works fine.
And is how i resolved this issue.
Thanks Constantin for help, for this i love unreal community. Always ready to help.
If I had more time, I’d actually implement my own “click/hover” system or fix one from UE.
Unfortunately I work not for Epic so can’t work on engine as much as I would like to, but rather choose cheap’n’dirty hacks like this to accomplish my direct tasks.
I just discovered and tested a quick solution for Click issue on UButtons in multiplayer VR environment.
Instead of using “OnClicked”, use “OnReleased”.
E.g.: replace:
materialSelectionBtn->OnClicked.AddDynamic(this, &AInteractableActorMenu::OnBtnChangeMaterialClick);
with
materialSelectionBtn->OnReleased.AddDynamic(this, &AInteractableActorMenu::OnBtnChangeMaterialReleased);
Note:
Same thing applies for blueprints (OnClicked doesn’t work, OnReleased works).
Note:
Still didn’t find a solution for “OnHovered On/Off” which are triggered on each tick even on cursor being still on button.
Just found a quick solution to click issue and posted as an answer.
Thanks Constantine. I just ran across this problem myself and your suggestion works.
For whatever reason OnClicked doesn’t work but OnReleased does.
Thanks again
It’s 2019. I had a client able to click 3D umg widget until a second client joined, then first client lost ability to click. Using OnReleased fixed this for me and ended this week’s multiplayer bug hunting nightmare =)
I’m in unreal 4.22 and vr umg widget interaction was broken for clients in certain cases. Posting a lot of search engine friendly text to help others.
It’s 2020; UE4.25. And in Bp event OnClicked from Client not work on 3d widget in VR. But onRelease works. Thanks a lot, Constantin!
I recently ran into this same problem with my multiplayer VR project, I have a simple solution. As far as I understand the problem with the 3D widget is that it conflicts with all clients that have the ability to interact with the widget.
Solution: I deactivated by default the Widget interaction component, and activate it during game start, only for the local player. This way all remote clients in your local game will have no effect on the widget.
I found a way to make it work in editor…
Inside the Widget Component OnRegister() the RegisterHitTesterWithViewport only gets called for the host viewport widget:
if ( CanReceiveHardwareInput() && bIsGameWorld )
{
TSharedPtr<SViewport> GameViewportWidget = GEngine->GetGameViewportWidget();
RegisterHitTesterWithViewport(GameViewportWidget);
}
A workaround would be to create your own Widget Component and override the OnRegister() function. You also need to register the client viewport which you can get via the GameViewportClient of the Engine ( GEngine->GameViewport). When you have this instance you can get the Viewport Widget via ClientViewport->GetGameViewportWidget();
The only thing left to do is RegisterHitTesterWithViewport.
void UMyWidgetComponent::OnRegister()
{
Super::OnRegister();
#if !UE_SERVER
if ( !IsRunningDedicatedServer() )
{
const bool bIsGameWorld = GetWorld()->IsGameWorld();
if ( Space != EWidgetSpace::Screen )
{
if ( CanReceiveHardwareInput() && bIsGameWorld )
{
if(TObjectPtr<UGameViewportClient> ClientViewport = GEngine->GameViewport)
{
TSharedPtr<SViewport> GameViewportWidget = ClientViewport->GetGameViewportWidget();
RegisterHitTesterWithViewport(GameViewportWidget);
}
}
}
}
#endif // !UE_SERVER
}
You also need to unregister it again.
It’s 2023; UE5.2. And in Bp event OnClicked from Client not work on 3d widget in VR. But onRelease works. Thanks a lot, Constantin!
Any update yet?