To clarify, the issues I discuss about are from the PlayerModule used when
Workspace.PlayerScriptsUseInputActionSystemis enabled.
As a Roblox developer, I find it very difficult to use the Roblox-provided PlayerModule within my experiences. Sometimes I have to figure out what some parts of the PlayerModule are doing so I have to go on a wild goose chase in order to figure it out.
The PlayerModule desperately needs a rewrite. It has so many issues with it that make it so much harder to understand what the scripts are actually doing. Even with the IAS update, which helped clean up some of the input code, there are still a lot of problems, some even introduced with the update. Some of those issues include:
- Horrendous type checking.
- There are 600+ type errors in the PlayerModule if all the scripts used strict mode.
- CommonUtils completely kills all of the type checking for the utility modules within it, and it is the cause of some type errors.
- Having utility functions that serve no good purpose.
CharacterUtil.getLocalPlayer()is literally just gettingPlayers.LocalPlayerandCharacterUtil.onLocalPlayer()is literally justif Players.LocalPlayer then
- Nonsense that is just there for the sake of being there.
- What the hell is the point of
CameraModule.CameraUI??? it can literally be scripted out entirely.
- What the hell is the point of
- Overcomplicating some things.
playerData.moveVectorandplayerData.isJumpingare only used byActionController.update,ControlModule::Update, andClickToMoveController::Update. Can’t you just run theClickToMoveController::Updatemethod which already fires the InputActions anyways and then make variables to store the states of theMoveActionand theJumpActioninControlModule::Updatewithout having to store it in theplayerData?ControlModule::calculateRawMoveVectorisn’t needed (at least for platforms that aren’t VR) because ofPlayer:Move(insert something here, true)already doing whatcalculateRawMoveVectordoes.
Many people use the default PlayerModule. If a developer would have to read through the PlayerModule to figure something out, they would have to look through all of this mess. If they have to fork the PlayerModule, they would also have to deal with all of this mess. The PlayerModule does not feel developer friendly.
If the PlayerModule were rewritten to use good type checking, have a good structure, not contain any unnecessary fluff, and be friendly for developers to read, it would help me and other developers use the PlayerModule in their projects. It would also remove some of the effort it would take to fork the PlayerModule and change it to how you want it to act.