ControlModule's GetMoveVector should not return a Vector with a length greater than 1

As a Roblox Developer, when I call the API GetMoveVector() from the ControlModule module, I’m expecting the movement direction to a vector between the lengths of 0 and 1. That way I can multiply the results based on my desired speed.

However after messing around with different control schemes, it seems that this is not the case. Moving diagonally with the keyboard returns a magnitude of 1.4 and using the class thumbstick for mobile players can result in a magnitude of around 3.4. These inconsistencies are a very annoying trap, and requires you to add additional size checks to make sure the magnitude doesn’t go past 1. Just normalizing it would remove the in-between values of lengths 0 to 1.

If it’s not possible to change this behaviour, at the very least having a new method with the fixed logic would be very helpful. Something like:
ControlModule:GetNormalizedMoveVector()

Quick Video of inconsistent GetMoveVector magnitude:

Addendum, I am aware that I can fork this script, but I think it would be much better if the native functionality for all users was improved instead of just focusing on fixing this situation for me alone.

7 Likes

It seems to me that Roblox completely forgot to clamp down the values when using the thumbstick. I could be wrong, but it might be reading past what it normally should when you slide your finger past the joystick’s border. Most likely an oversight?

My guess is that it cannot be changed now since devs may be relying on this behavior. It does seem to be useful to have the desired move vector pre-normalized, since you can always normalize it yourself. With it un-normalized, you can use the extra data to more arcuately interpret user intent when are controlling vehicles or other things that have independent interpretations of each axis.

4 Likes