[SOLVED] Teleporting enemies when got hit

here is my code

i set guardianPlacing=“right” and guardianLive=3

that code work for just one time teleport. if i hit it again the preview just stopped working when playerHb collision with Guardian hit box. How can i fix this?

try the collusion check without trigger once, and put the placing conditions as subevents, wich trigger once.

sorry can you get more specific? iam still confused

like this:


change variable blink set to 1 is a placeholder for your make guardian blink

i am not familiar with the blink extension. it could be that both subevents fire and guardian teleports left and right.

if thats the case try this:


that is assuming that the blink extension prevents collusion
if it does not, you need to do it like this:

Learn to use Subevents is very helpful. it helps you to group your events together and also improves performance, since the game needs to check less conditions.

As Slash said, it’s more readable and i can also add that written like that, it looks more and more as structurated programming language instructions.

thankyou for your advice… but this still dosent work. i think you are right theres no problem with blink extension. i’ve been try your code and gave me simillar result but this time the preview still work fine but the enemies wont teleport again.

really?
can you post a screenshot of the 3rd method of mine you did?
i am pretty certain, that it should work

here… sorry if i doing something wrong there

update: whit this code the preview stopped working again. after hitting the enemies for the second time.

I tryed it myself now and you are right, it does not work.

i found a working one tho

in your case you set the X() of guardian = Gur
and the condition guardian X() = Gur.X() for changing Placing
like this

Thanks man…it work :smile:

Is this question solved?