Question by
poncho4242 · Dec 13, 2015 at 11:20 PM ·
c#aienemyglitchteleporting
Why does my enemy teleport to my player?
I'm running into a glitch where my enemy is teleporting to my player. Can anyone help me to rewrite the code so this doesn't happen?
Link to video showing enemy glitch teleport.
screen-shot-2015-12-13-at-41722-pm.png
(165.2 kB)
Comment
Answer by jmonasterio · Dec 31, 2015 at 09:47 PM
Because you need to yield in the Attack() function when the distance > 5f. Otherwise, you're just running that while loop all in one frame.
Answer by CraftyMaelyss · Sep 08, 2016 at 10:46 AM
You've set the video in the link to private, so I can't really help, sorry :(