Unity 2022 Missing Legacy Input Events
tracked
Dinky_
Currently there are two ways to get user input. The Official VRC Input Events detailed here https://creators.vrchat.com/worlds/udon/input-events/
And the standard Unity Input System commonly accessed with GetButton("string"), GetButtonDown("string"), GetButtonUp("string") among other ways.
Many worlds are built on "legacy" button names detailed here https://docs.google.com/spreadsheets/d/1_iF0NjJniTnQn-knCjb5nLh6rlLfW_QKM19wtSW_S9w/edit?pli=1#gid=1150012376
Which can also be seen as created by the VRC SDK in Unity (see relevant attached photo)
In the current auto-conversion of old worlds to Unity 2022 GetButton("string") works as intended. However GetButtonDown & Up are now broken. This has been observed outside of VRC in Unity as well as evidence see this user complaint https://forum.unity.com/threads/solved-getbuttondown-getbuttonup-with-the-new-system.876451/#post-5764510
Upon further research I discovered that Unity released a new Input system for testing in 2019, but it was required with 2020 and on. So we must be on the new input system. https://blog.unity.com/technology/introducing-the-new-input-system
Since many worlds, especially old ones relied on using GetButtonDown & Up this is breaking a lot of functionality. It might be possible to retroactively convert current user input to running Down & Up.
I personally only use the code to get menu button input as VRC never finished giving us every button in the official VRC Input events. I request either a fix that redirects input into the old Down & Up to fix worlds that won't be updated, or perhaps finishing the VRC Input Events system to include all possible user inputs (which is well overdue).
At the least somewhere in patch notes It should be noted that legacy input settings are breaking in Unity 2022. And even better if that patch comes along with the complete VRC Input Events update and a message telling creators to move to the new system or risk worlds breaking. As it stands now worlds are breaking with no heads up, and furthermore no solution if we want to use VR controllers Menu Button with VRC Input Events.
I observed the issues on Windows Mixed Reality, and Index. Seemed like some friends on other headsets weren't affected so could be you guys already implemented a solution but missed some hardware?
I have a test world focused on the VR Menu Buttons here using "Oculus_CrossPlatform_Button2" & 4
Also worth looking into on subject https://feedback.vrchat.com/udon/p/input-events-like-inputjump-inputuse-still-triggered-if-the-gameobject-is-disabl
Log In
StormRel
tracked
Dinky_
And just incase anyone finds this post and needs a fix for their broken GetButtonDown/Up code, you can simply do something like this
private bool myBool;
private void Update()
{
if (Input.GetButton("myButton"))
{
//GetButton code goes here
if (!myBool)
{
myBool = true;
//GetButtonDown code goes here
}
}
else
{
if (myBool)
{
myBool = false;
//GetButtonUp code goes here
}
}
}
Dinky_
Did some further testing this morning using Desktop GetButton/Down/Up & GetKey/Down/Up. All 6 input codes work both in Unity Editor and in a built VRC world. I only used the space key and "Jump" button for testing, but I assume the rest runs the same.
That makes me think the issue only affects certain VR devices. Would need further help testing as I only own one set of controllers/headset.
Or it could be the "Jump" button was maintained but "Oculus_CrossPlatform_Button2" & "Oculus_CrossPlatform_Button4" were not
Edit: Further Testing on Quest 2 - would only run code after input events every ~10 clicks. Very inconsistent, but does occasionally work.
So it is definitely related to hardware. Can't test further headsets, but if someone has the commonly used ones beyond Quest 2 would appreciate feedback.