When an Enemy gets within X units of the player, it begins to chase the player. When the player touches the enemy, the enemy goes flying/spinning into the air, then is destroyed after a delay node completes. Once touched, the Chase node is disabled so that the enemy doesn't try to fly back to the player while it's being killed. (It was doing that.) The Chase node works by measuring distance from enemy to player, then using a vector3 around its defined x/y/z speeds to send it in the direction of the player. It's not perfect but good enough for a prototype. Problem: Disabling the Chase node on the flowchart disables it for every instance of the enemy, including new ones that are spawned in. The untouched enemies should still continue to chase. Question: I'm new to BuildBox. Can someone explain to me what I need to change in order to only apply the deactivation to a single instance of the enemy (e.g., only the individual enemy the player touched) instead of applying it to every enemy? Thanks a bunch.
I'm still new to coding, but I do know the problem. The Disable script needs to be edited so that it works only on "this.entity()". Could you show the script so that we may be able to help you?.
if ChasePlayer node inside one enemy affects all enemies, then it must have a global variable like Settings so you have to change this variable to local as Josh (Nology Games) says... Could you show the script so that we may be able to help you?.