#Check what input method a UI button was pressed with (controller, keyboard, mouse click or tap)

1 messages · Page 1 of 1 (latest)

robust laurel
#

does anyone have a solution

frozen stream
#

Might be an asset pack out there that could do it for you

#

I've had to make separate Input Actions for different input types and handle them slightly differently

robust laurel
#

didnt find any when searching sadly

frozen stream
#

I made one for finger tap touch inputs and a separate one for mouse clicks

robust laurel
#

im considering just checking for if the button is the eventsystem selected object when a button is pressed

#

not sure if its already deselected by then though

#

gonna try that when i get home in a few mins

robust laurel
#

im not using the new input system

frozen stream
#

Oh

#

Then it's going to be very very hard

robust laurel
#

oh

#

you'd think that'd be simple in one of the world's most popular cross-platform game engines

robust laurel
#

i may have thought of a solution

#

ill store the previous EventSystem selected object every frame first

#

and then, if the eventsystem previous selected object gets pressed, i know it was pressed with navigation

robust laurel
#

ive created an unreliable solution

#

with what i described

#

it works but very badly

#

:/

#

gonna keep trying

#

ok my solution is too unreliable, instead imma just scrap the idea and check if a controller is connected
if people are pressing buttons with a keyboard, controls will be different and players will press a number to choose a slot to move to