So long story short, I’ve completed the Turn-based Strategy Game tutorial and I’m looking to expand the game a bit. I want to add a health potion/pack to allow players to heal a unit and continue fighting. I’ve gotten most of the way there on my own. I’ve set up a “HealthPack” script that extends the IInteractble interface, much like the door or InteractSphere. Everything works, and I’ve also got the LevelGrid updating before the object is destroyed so it’s properly removed from the scene.
Now, my last hurdle is getting the HealthPack to talk to the Unit who selected it, and heal them. I have a function in the “HealthSystem” script to restore their health to the max, but I’m unsure of how to tell the function to run. I need to create a connection between the instance of the HealthPack that was selected, and the Unit who selected it. Any tips or advice?