Hi! I have this problem where I have two widgets in the same level, one is for inviting steam friends, and the second one is for starting the game.
Problem is, that when I click on my “Social” button, it opens the level (I have to use my “IA_Interact” on both of them, as the “On clicked” buttons won’t work in 3d for some reason)
I followed this tutorial and made it 3d myself!
Does anyone know how I could either:
Stop level from opening from every widget other than “Start Game”
Make the buttons work, so player walks up to them and clicks for XXX thing to happen, instead of all widgets triggering at once (For example, the level opening when clicking “Social”
Sorry if my explanation was difficult to understand:D
IA_Interact will not work in this way. As far as I’m aware, 3d Widgets lose the built in input handling (clicks, touch for Mobile) that you get when you draw widgets in the regular, 2D way.
I have solved this in the past by adding an invisible sphere or box around the 3D widget. Then you can use the on click from that mesh to behave as your button click.
This worked in my (very simple) case, but as I mentioned, you lose built-in Widget interaction features like hover and mouse up. As soon as you want to drag, scroll or any other common UI features, this will fall apart.
FYI, InputActions are used to take input from a device (controller, kbm, etc) and pipe it to your game. So the IA_interact nodes you have placed are firing everywhere at the same time. In short, the “correct” way to handle this is to have the Input handled in one place (usually a subclass of PlayerController), which then calls functions on the relevant actors.
there’s a component that casts a ray and emulates a mouse, you can send clicks and other events. and makes world widget work somewhat like regularly. (more like if you were using a tablet, some events are missed). i can’t recall the exact name but it’s easy to find.
one caveat is, you can only have one of them active at any time.