SDK 3.6.1 broke Input.GetKey
available in future release
SpaceCowboy121
Title says it all. Input.GetKey() used to work in Udon# v3.6.0 sdk. Now it doesn't it always returns false.
Example test script screen shot in brand new project. Unity 2022.3.22.f1
Other input events might be broken as well. I have not tested them.
Rolling back to 3.6.0 fixes the issue.
Log In
Missing_
The code that increases an integer count when the arrow keys are correctly input in order, and triggers a function when a specific number is reached, is still not working. This issue occurs across all worlds. Please check.
Fax
Merged in a post:
SDK 3.6.1 - Input.GetMouseButton() not working in ClientSim
TeaVirus
After upgrading from 3.6.0 to 3.6.1, Input.GetMouseButton() doesn't work in ClientSim. If I revert back to 3.6.0, it works again. Using Unity 2022.3.22f1 and up to date VCC. Tested with a new Worlds project and the following script added to a cube. Seems to work fine in
the VRC client.
public class Test : UdonSharpBehaviour
{
bool _lmbIsDown;
MeshRenderer _cubeMeshRenderer;
MaterialPropertyBlock _propertyBlock;
void Start()
{
_cubeMeshRenderer = gameObject.GetComponent<MeshRenderer>();
_propertyBlock = new MaterialPropertyBlock();
Debug.Log("Test script initialized.");
}
void Update()
{
if (!Input.GetMouseButton(0) && _lmbIsDown)
{
_lmbIsDown = false;
_propertyBlock.SetColor("_Color", Color.red);
_cubeMeshRenderer.SetPropertyBlock(_propertyBlock);
}
if (Input.GetMouseButton(0) && !_lmbIsDown)
{
_lmbIsDown = true;
_propertyBlock.SetColor("_Color", Color.green);
_cubeMeshRenderer.SetPropertyBlock(_propertyBlock);
}
}
}
Tom Leylan
Are there any suggested workarounds for a) this bug and b) any other bug that is basically a show-stopper? I'm trying to understand if the solution is to simply move back a release or whether some sort of fix or patch will be released shortly?
Z0NE
Tom Leylan If your inputs are WASD or other generic movement keys, you could do something like this:
float vertical, horizontal;
bool pressForward, pressBackward, pressLeft, pressRight, pressJump;
public override void InputMovementHorizontal(float value, UdonInputEventArgs args)
{
horizontal = value;
}
public override void InputMovementVertical(float value, UdonInputEventArgs args)
{
vertical = value;
}
public override void InputJump(bool value, UdonInputEventArgs args)
{
pressJump = value;
}
void ControlChecks()
{
pressForward = vertical > 0;
pressBackward = vertical < 0;
pressLeft = horizontal < 0;
pressRight = horizontal > 0;
}
void Update()
{
ControlChecks();
}
The way the floats will increase & decrease to maximum will be different to the GetKey methods but should work just about well enough for testing in ClientSim.
If you are binding other keys, the only real solution is just to endure testing in VRC instead of ClientSim from what I can tell...
Tom Leylan
Z0NEThanks... I might try to a handler for ClientSim but (obviously) I would prefer not to add code to handle that specific case. But it might be worthwhile if the fix is a significant way off.
Fax
Merged in a post:
GetKey/GetKeyDown/GetKeyUp returns always false since SDK 3.6.1
Shiro K
Add this in an update loop and press F1:
Debug.Log($"Down: {Input.GetKeyDown(KeyCode.F1)}");
Debug.Log($"Held: {Input.GetKey(KeyCode.F1)}");
Debug.Log($"Up: {Input.GetKeyUp(KeyCode.F1)}");
Down should return true in the frame the key was pressed. Held should return true while the key is held. Up should be true in the frame the key was released. This fails since SDK 3.6.1 in the ClientSim. But it works on live.
Shiro K
Also found on GitHub:
This post was marked as
available in future release
Fax
in progress
Thank you for the report! We're working on a fix.
This bug appeared because VRChat recently started blocking
Input.GetKey
unless VRChat's menu is closed. (See https://creators.vrchat.com/worlds/udon/input-events#unity-input-methods-and-properties)In the SDK, there
is
no VRChat menu, so input was erroneously being blocked all the time! We'll have it fixed in the next SDK release.Missing_
Hello : )
My world has something that works when I get the commands right, but only that feature is broken in the game.
Simple Input seems to work normally.
But on the clientsim, everything is broken.
みみー/Mimy
This bug seems to exist only in ClientSim.
When I tried it, it worked as expected in the test build.
FYI: That's why I submitted an Issue to ClientSim's GitHub.
Z0NE
みみー/Mimy Yes, it's exclusively a ClientSim bug!
StormRel
tracked
Load More
→