Hi
Hope someone can help. I'm having trouble with multiple instances of a node.
Enemies using the same script or just duplicated node go to the same place and do the same things.
if you randomize a target location with
randomnum = rand_range(-100, 100)
randomnum2 = rand_range(-100, 100)
target = Vector2(randomnum,randomnum2)
they all go to the same place, if i set up an Area2d them on collision queue_free() deletes the one collided with and not the rest as expected but if i set up the target with something like this
func _on_Area2D_body_entered(body):
if body.is_in_group("player"):
target = body
ALL the duplicated objects now have a target! shouldn't ONLY the COLLIDED one have the player as target?
why do all the enemies get sent this info?
Hope someone can explain
Thanks