Week 3: Interaction System + HSM
A downloadable tool
This week I wanted to create a simple and easy to use interaction system that allowed for robust additions; so I did just that. However, before doing so I needed to set up some kind of player movement system. After a lot of thinking (and searching), I decided to go with a Hierarchical State Machine.
I followed a tutorial by IHeartGameDev then refactored the code to my liking. The link to the playlist is linked below, much thanks!
The player prefab provided can walk, run, jump, and interact using states! Other states included are, grounded, falling, and idle (lot less flashy huh).
Now that the movement has been set up, the interaction system is ready to be tackled. Here I created a inheritance system that starts from an interface. This is then inherited by a master interaction class which holds variables and functions all subclasses will need. While more will be created in the future, I have only set up character and item interactions.
Character interactions, for now, start the dialogue tree that was made last week with full functionality. Items will be collected, and optionally destroyed, then get added to a player inventory.
This is all for now! I will be back sooner rather than later hehe.
IHeartGameDev HSM playlist: https://www.youtube.com/playlist?list=PLwyUzJb_FNeQrIxCEjj5AMPwawsw5beAy
DISCLAIMER: THIS ONLY WORKS WITH UNITY
| Published | 24 days ago |
| Status | Released |
| Category | Tool |
| Author | Brandon Wahl |
| Tags | tools |
| Content | No generative AI was used |
Download
Click download now to get access to the following files:


Leave a comment
Log in with itch.io to leave a comment.