Hi guys, thanks for the responses! So I should go into depth a little more on what is going on. Picture an old school super Mario game except the enemies you come across you fight using combos, specials, etc. This is a 2D game, I should note. It’s not an asset, it’s actually a project I’m working on, one of my first in Unity actually. Also, the healthbar is just a small thing, but every enemy you run into has a healthbar over their head, and I haven’t used the worldToScreenPoint mechanic yet, I’ll probably implement that later.
So, I’d say my biggest problem is making things easier down the road. I’ve been doing a lot of restructuring code to make code I’m using flexible with all objects. Simple code like enemy movement, getting hit, targeting the user, and things like extensions for fading or other general game functions.
So, let’s say the user holds the grapple mechanic and I switch to it after a specific collision happens. I’m still aiming to deactivate the enemy and once the grapple is done playing, I want the enemy to be reactivated, and I want to change it’s variables and position, as in decrementing it’s health or changing the enemy’s position and sprite to a knocked down state.
So, if I go down this route, how do I find the enemy I just collided with after deactivating it previously? Is there a way to store the enemy object into a gameObject var through the collision code, where I can then bring it back out after the grapple? And, more importantly, putting all that aside, is this the route I should go if I want to use the grapple mechanic on a common basis?
This is more of a brainstorm for me, so I was just curious how I can do this more efficiently. And I’m not really looking for tons of coding help, it’s more of a ‘what is the right way to go about this’ thing. Hopefully, I put this in a better way