On the subject, any chance of a gamepad gyroscope API? I remember the idea getting shot down a few years back since only Xbox controllers (which don’t have a gyroscope) were officially supported - but with the PlayStation launch I’m hoping the team can revisit.
Hey Roblox Staff, I just wanted to mention that when the game releases on PS5, I think it would be cool if you allowed game developers to access the PS5 Dualsense Controller Adaptive Triggers through the scripting. Same thing if PC players use the PS5 Dualsense on PC.
Are we able to script the controllers vibrate? (I forgot what the vibrate is normaly called)
This may have already been addressed so I do apologize if this reply is redundant.
On future platforms that Roblox decides to ship on, will the mappings for that platform’s KeyCodes be based on that platform’s UX, or will it be based on button placement?
My current fear is that without introducing new KeyCodes for new platforms and instead just remapping new platforms to the Xbox platform, you’ll eventually run into the issue where for example, on a Nintendo Switch the A/B buttons are inverted in relation to an Xbox controller - however, ButtonA is still to confirm and ButtonB is to cancel. If ButtonA on Xbox is directly mapped based on location to ButtonB on Nintendo Switch, it becomes impossible to fix the UX as developers will be unable to rebind anything using ContextActionService.
Hi!
This is a great question, currently the idea is to map the current abxy key codes in the Xbox layout to whatever new platform Roblox may ship to. This would be KeyCode.ButtonA would map to the B button on the switch controller and the API listed here will correctly give you the image to display. In this way, your experience mappings will “just work”. A Switch controller connected to a PC and playing Roblox should work this way already.
There are no plans to release key codes per platform, this adds work for every developer to support new platforms and would require older experiences to be updated, many of which may not have active development. To keep these older experiences working, the existing keycodes are the ones we will continue to support.
Thanks
It seems like the buttons on Dialog hasn’t been updated to work with playstation buttons.
Hello,
This would be KeyCode.ButtonA would map to the B button on the switch controller and the API listed here will correctly give you the image to display. In this way, your experience mappings will “just work”.
I understand how this would “just work” for returning the images to display, however my concern lies within utilizing ContextActionService to bind certain actions and menus within my experience. You directly stated ButtonA would be mapped to ButtonB on a Switch and no new KeyCodes would be created, meaning as a developer we will basically just have to bind our confirm actions to ButtonA for Xbox and anyone on a Switch will just have to deal with a horrible user experience - as they expect opposite behavior from those buttons.
Surely you would want to prioritize maintaining the expected user experience on new platforms otherwise you’re directly inhibiting the success of Roblox to a degree as it’s brought to these new platforms.
this adds work for every developer to support new platforms
As a developer, I could Ctrl+F my code and search for anywhere I utilize ContextActionService and simply add KeyCode.ButtonCross next to anywhere I currently have KeyCode.ButtonA.
and would require older experiences to be updated
This is the only real concern I could see with the introduction of new KeyCodes. Old KeyCodes could retain functionality but be deprecated and removed from the public API just as many other things have been in the past, and any old experiences utilizing KeyCode.ButtonA alone could then fall into a “failsafe” where ButtonCross on PlayStation and ButtonB on Switch are default binded. This would result in 0 work for developers and would simply require a bit more creativity on the Roblox side.
A portion of my experience’s success is reliant on my UX, people have entire careers in solely UX, however if I have no control over fixing my UX, then why would I bother with releasing my experience on these new platforms as I’m inherently going to worsen not only my player retention, but also my Like:Dislike ratio.
Thanks for the report, we’ll look into it.
I understand where you’re coming from and appreciate the detailed feedback. For now we’re interested in keeping the button layouts the same rather than the actual images that appear as well as maintainable long term solutions. I suggest posting these concerns in a feature request so that it is logged for future reference.
Thanks!
Heres a spritesheet for playstation buttons i put together
ill probably put one together for nintendo switch if roblox comes out to that
Also by the way controller haptics don’t work with the PlayStation Controller
It doesn’t seem like it’s possible to distinguish between the PS4 and PS5 share buttons with UserInputService:GetStringForKeyCode since they all return ButtonShare, is that correct? This means it isn’t possible to use different custom images for the share button between the PS4 and PS5.
However when using UserInputService:GetImageForKeyCode they return the correct share button image for the PS4 and PS5 respectively so internally it seems like Roblox knows the difference somehow.
Or is there something we’re missing?
Console uses trackpad instead of share button
UserInputService:GetStringForKeyCode(KeyCode.ButtonSelect) returns ButtonShare on both PS4 and PS5. However UserInputService:GetImageForKeyCode(KeyCode.ButtonSelect) returns different images for PS4 and PS5.
So it seems like there’s no way to override the image for KeyCode.ButtonSelect differently on PS4 and PS5, even though internally Roblox does override it differently via UserInputService:GetImageForKeyCode(KeyCode.ButtonSelect).
Hi!
Please use
Both overrides for the PlayStation mappings.
@bluebxrrybot @TheNexusAvenger @Abcreator
Hi!
Please check out the icons again, they’ve been updated to be clearer and higher resolution. Please let me know if there are any issues.
Studio now has a PS4 emulation mode that you can use to test these APIs with! Please give it a try and test how your experience might look on PS4 with the APIs
Will we have access to APIs that would allow use to have Adaptive Triggers later or on release? I haven’t read anything about it yet and it could provide great potential for our experiences.
Also, there is a difference between the Share button (PS4) and the Create button (PS5), aswell as the touchpad and the Options button. These three would all require different icons on the PS4 and PS5. As you stated that Controller device type will not be readable how could we implement this difference?
And, one more question, will we get access to accelerometer and gyroscope data of all controllers?