Input events like InputJump, InputUse still triggered if the GameObject is disabled
MyroP
Events like:
- InputUse
- InputJump
- InputMoveHorizontal
- InputMoveVertical
- InputLookHorizontal
- InputLookVertical
Are still called even if the GameObject is disabled with SetActive(false) (See screenshots).
But disabling the script with enabled = false; works.
I am not sure if this is an expected behavior, but personally that issue confused me, If I disable a GameObect I would expect everything to be disabled, not just certain events like Update(), FixedUpdate(), OnDeserialization()...
Log In
Occala
Just encountered this and it was very surprising, can't say whether it should technically be the case or not, but it doesn't feel good. I feel that if I expected disabled gameobjects to receive input events, I'd be polling them in some central spot and passing them out myself
Accounting for the gameobject being disabled in hierarchy in all code that uses VRC's input events isn't very intuitive
Fairplex
If we compare with regular C#, its possible to call public methods from a disabled script. I think this is intended behavior.
iffn
I checked this bug as well and it seems to happen when the GameObject is enabled by default and then disabled by a script. When the GameObject is disabled by default, the event does not get called. I think the assumption is that the GameObject hasn't registered the event yet.
Not sure if this is the intended behavior but it does seem to be quite counter intuitive.