ahhhhhh i'm stuck.
First time encountering this.
I instance some enemies > when my projectile hit they do all sort of things :
- slow them down.
- apply damage
- apply damage over time
etc... All this works perfectly. it only affect the body the projectile has touched.
But. When i want to make a projectile that make the enemy walk back to it starting point with getsimplepath, ALL the enemies turn around instead of only the one i hit.
The process is the same for ALL the other effect projectile does. But this one is problematic...
Any idea why ? is there a work around it ?
Here is my code :
enemy.gd which i instance:
Header part :
var path : = PoolVector2Array() setget set_path
Rest :
var navsendback = getnode("/root/MAINMAP/Nav/")
var navsendbackposition = getnode("/root/MAINMAP/startposition")
var pathsendback = navsendback.getsimplepath(self.position, navsendback_position.position) # we calculate their new path if any.
set_path(path_send_back)
so when ever i update the path... it affect ALL instanced enemies. not just this one...
Any idea why ? thanks guys !