I need to move/rotate an physics handle holding and object by pressing widget buttons.
Until now i can do this by holding down keyboard inputs.
I cannot achieve the same results by holding down widget buttons.
I though it would be something simple to do, but Im not finding a solution.
I need this to work because end-user will be interacting thru touch devices, no keyboards or other controller.
Keys will appear on screen/viewport
You need to better explain where you are stuck at. Is it a communication problem between the widget blueprint hosting the buttons and the blueprint of the physic handle?
Right.
The problem is that Widget Button do not behaves as keyboard button input.
I can control perfectly control the physics handle movement and rotation with keyboard. In this case with Y for up and U for down.
But i don´t know how use a widget button as keyboard input axis. If it´s possible.
Ok, so if I understand correctly, your system works with the InputAxis node because this node is called every frames. Now you want to do the same with two widget buttons : one that you hold to move the handle down and the other one that you hold to move the handle up. Is that correct?
Sure, providing you’ve extended the button - it then becomes a standalone widget anything can talk to. You can have a Custom Event feed data to an overriden onKeyDown or a Tick solution. It’s probably over the top, kind of depends on what you’re doing. For something simple go for the hackaround.
And yet another alternative is to use an Event Dispatcher from the widget to the Player Controller - this can be useful:
you generally want as much functionality outside of the widgets as possible
you may have stuff set up in the Player Controller already
no need to create direct references and no expensive casting
no more Accessed None errors if you lose your widget for any reason
This allows you to hook up the buttons to the already existing setup you may have anywhere else. Also, becomes pretty much an indispensable way of sending a bunch of data once your interface becomes somewhat complicated.
Ok, yes. I need to keep all functionality inside my Player controller, so I go for your last alternative. Thanks you very much, man.
I promise I´ll come back to mark it as solved : )