I’m starting to implement the item system and the first thing I did is the item pickups. Before that I had to teach packlings how to interact with… well, interactable stuff. This little fella spent half an hour punching the essence pickups before actually interacting with them, relatable, right?
Nothing fancy really, just a new tag called “interactable”, adding a call to an “InteractCommand( GameObject )” when clicking on an object with said tag, modify the basic AI to execute that action properly (including the slippery “move in, then interact” when outside of interaction range), creating an “IInteractable” interface (because who doesn’t love some over-engeneering) and implementing it on an ItemPickUp script.
For the graphics I also created the double helix model in blender and put an additive shader on it, plus a projector for the glow on the ground. I reused a transform lerp script from another project to add the “item flying towards the packling” effect and modified the DamageDisplayManager to also display item pickups amounts and names (now it is the “DamageAndPickupsDisplayManager”).
Next up: The inventory system and make enemies drop items. Also, auto-pickups for stuff that there is no downside in picking up, to save players the hassle of clicking.