sorry i know i post a lot here … and i solve a lot of my own threads through the rubber duck effect … this forum is really helping me out though and i hope i am making it easier for future developers through my solved thread content.
“enemy” is a gameobject tag. all enemies will be tagged enemy, or so far that is the plan. attacking is a state in a finite state machine, along with approach enemy, idle, move to point, and that’s all so far. attacking has an animation based on the angle of the hero to the enemy, and tests whether it hits or misses (then if it hits deals damage). pretty simple.
so far this only works with one enemy and that is my problem. how can i make it so it “targets” only the enemy that is clicked on? so far i have no ideas but don’t be surprised if i come back with an edit in like 2 minutes lol
edit: here’s some code -
void Attack(GameObject enemy1) // again, this just refers to one enemy. need to fix!
{
if (enemy_clicked == true)
{
AttackEnemy(enemy1);
}
}