So what i want is…when the character faces an enemy and enemy attack character with ranged attack, the ranged attack will not return to the character when character is on otherside of enemy.
The point is i want the enemy attack not returning and just going to the first time its shot.
Try Switching positions of your events add force and crate object. The object needs to be created first so that GD knows to what object the force is applied to.
can you upload your json file?
it has to do with your event structure.
if your repeat for each is moved away from the mainevent, that is not trigger once, it should work.
Just to explain to you what I see if happening, and why slash is asking you to move the action:
Each event has columns: The conditions and actions.
When every you reference an object in a condition it becomes “selected” for all matching objects. This selection is inherited by sub conditions as well.
Actions that reference objects are applied to all “selected” objects of that type. When you create a new object it becomes selected only for that current action (not sub events).
So in your case you are not referencing EnemyBasicAttack objects in any of your conditions, so when you preform an action on EnemyBasicAttack it assumes you want to apply that action to ALL EnemyBasicAttacks.
So you can either add a condition that references the newly created object (typically by setting and referring to a unique instance variable value) OR more simply move the action on EnemyBasicAttack to the action block where you created the object (and where it will be automatically “selected”).
I hope that helps explain better how it all works (at least from my experience as a user)
The problem is, that the condition if frame = 2 doesnt seem to always trigger.
i changed your plant to 3 animations, where the second animation ends with the attack, and the last animation is the cooldown.
this way the engine has all the time to check if animation is finished, instead of if framenumber is …