Nestorboy / NUMovement

A custom Character Controller implementation and prefab for authors of VRChat worlds.
MIT License
14 stars 1 forks source link

Enabling Scale Movement breaks the controller when testing in the editor #3

Open iffn opened 2 months ago

iffn commented 2 months ago

Enabling the Scale Movment checkbox causes the NUMovement controller to break in the editor when testing.

Error message:

UdonSharp] Packages/com.nessie.udon.movement/Runtime/Scripts/NUMovement.cs(230,29): Udon runtime exception detected!
  An exception occurred during EXTERN to 'SystemSingle.__op_LessThan__SystemSingle_SystemSingle__SystemBoolean'.
      Parameter Addresses: 0x00000024, 0x00000067, 0x0000013B

  Cannot retrieve heap variable of type 'Int32' as type 'Single'

Pointing to this line: https://github.com/Nestorboy/NUMovement/blob/01549e29e1a123f3b5668334b899f8d02456b163/Packages/com.nessie.udon.movement/Runtime/Scripts/NUMovement.cs#L230

Tested in a fresh project with the current version:

Screenshot: image

Nestorboy commented 2 months ago

I've tracked down the issue to the introduction of the OnAvatarEyeHeightChanged event in ClientSim 3.6.0. The initial invocation of the event passes prevEyeHeightAsMeters as an integer, when it should be a float. Since the values are boxed there was no indication of type mismatches and was probably overlooked since I guess not a lot of people use this event.

Here's the line in question: https://github.com/vrchat-community/ClientSim/blob/43e43b046fa2aff9b31d64698fc0868df43b44eb/Packages/com.vrchat.ClientSim/Runtime/System/ClientSimPlayerHeightManager.cs#L48

I don't think it's worth addressing this on my end by checking the type for a temporary solution, but I have gone ahead and created a PR fixing the issue, and I'll close this issue once it has been resolved: https://github.com/vrchat-community/ClientSim/pull/119

Nestorboy commented 2 months ago

I forgot to mention it, but I ended up making a Canny as well: https://feedback.vrchat.com/udon/p/initial-clientsim-onavatareyeheightchanged-causes-type-mismatch