What is Priority5?
Priority 5 is a priority based state machine, I made this tool to make state management for player characters easier in combat games (I recommend this module for any type of game that has something to do with changing a humanoid property)
→ Priority based state machine sounds fancy, what does it do exactly?
well first you need to know what a state machine is, I’m not going to explain it but if you want examples look at how humanoids have multiple states for each action (example: Idle, Running, Jumping, etc…), Priority5 is basically an state machine but adds priorities to them similar to the priority property of animation objects
→ Example use cases
In a fighting game, you would have states like Walking, Sprinting and Stunned and you wanna be able to transition between the states seamlessly without causing bugs (example: sprinting while being stunned )
sure, you can fix this by doing TONS of if statements in your code but thats not really ideal
With Priority5, you can set a priority number to your states just like how you set the priority property of animations (that’s where I got the idea of priority based state machines from lol), and when a state with a high priority is enabled, all the other states will be deactivated.
→ That’s not all!
I’ve recently added a new feature that’s called Weight ← link to the api document
with this, you no longer have to create individual states for every little thing in your game (example: lowering player speed when swinging a sword), it allows you to quickly and temporarily put weight on all the states on the player and remove it whenever you want.
API Documents
Github
did unit testing on the module by using testez to make sure that everything works as expected.