So I’m trying to make a system where you need to press the order of keys that show up. For console support, I’ve tried using UserInputService and ContextActionService. Neither of them detect the ‘A’ button. I’ve tried multiple controllers, tried print lines–no luck.
The code for using ContextActionService (I decided to switch over permanently, if possible):
I’m not sure if this is correct, but I believe the default use of Button A is to allow Xbox users to jump. I suppose any other use of this button wouldn’t work, since it might interfere with the jumping animation.
Have you tried binding it at a higher priority to check if it is in fact a case of another action being performed and sinking the input?
Ideally you want to be the highest priority and actually sink the input yourself afterwards to prevent things like jump from performing afterwards while you are in this particular context.
Not sure, because I’m not an Xbox player myself. I believe what @BanTech suggested would probably help, because making the ‘A’ button a higher priority should “override” the jumping action.
I agree, I can’t see anything immediately wrong with what you’ve shown. It’s not easy to fully check your code due to a lack of monospaced font, but it looks okay to me.
The device check may be an issue given you can’t actually check device on Roblox, but in general my guess is the issue is elsewhere when binding this handler or defining the device.
Well UserInputService above all else should work without any problem, regardless of priorities and whatever else, UIS will work.
If it doesn’t, the issue goes deeper into your code.
The easy way to check is to have a completely blank baseplate, add just that handler with your BindAction line, and check it correctly fires for all 4 buttons. If A still doesn’t work you know it’s something with this bit of code. If it does work then you know it’s something else in your game.
Supports the theory that the input is being sunk in another bound action, but if you say you’ve tried binding at a very high priority and have tried UIS then that contradicts it.
UIS would work, but gameProcessed would be true.
Binding at a very high priority would also work.
If neither work and you’ve done what I suggested with a blank place with only this code in it and nothing else, then I don’t know what else to try. I use ButtonA for lots of things without issue so there’s more to this.
Please share your BindActionAtPriority and UserInputService attempts as well as your blank baseplate attempt to just double check there isn’t anything wrong with those that is adding confusion to the mix.
“I did it! I did it! I did it!..okay, we did it.” - Dr. Suess’ The Cat in the Hat Movie
Okay, so after screaming at my monitor for…mehhhh, around 30 minutes, I figured out the issue. It was getting caught in the if statement, if processed then return end. Don’t ask me how, I have no clue.
The way I fixed it was changing that if statement to: if processed and input.KeyCode ~= Enum.KeyCode.ButtonA then return end. Hacky, but it works for now. This appears to be a bug, though.
The GameProssedEvent boolean seems to always return true when ButtonA is pressed which is really annoying. This post actually stop an hour worth of headaches. Thank you