[SOLVED]Teleporting enemies when got hit


#1

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?


#2

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


#3

sorry can you get more specific? iam still confused


#4

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.


#5

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.


#6

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.


#7

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


#8

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.


#9

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


#10

Thanks man…it work :smile:


#11

Is this question solved?