How to make Actor move again after completing a Move To

I have an actor (enemy) set to Move To another actor (hero). I have at some points made the hero invincible so that the hero can pass over the enemy without dying. The hero does not die but the enemy stops moving since it has reached the exact X/Y of the hero. I need the enemy to continue 'chasing' the hero and not stop even though the Move To is complete.

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    edited February 2014
    Misunderstood - you want the enemy to constantly chase the hero.

    Try using just a 'move' behaviour with the 'direction' set to the player X

    Then use a second move behaviour with the direction set to the player Y

    See if that works :D

    QS =D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • SocksSocks London, UK.Member Posts: 12,822
    @SBorgstrom


    Here's another way of doing it:


    File: https://www.mediafire.com/?s59g39j56z6zl56
  • SBorgstromSBorgstrom Member Posts: 3
    Ive tried the Move instead of Move To but it doesnt follow the hero rather just sends it iin the direction of the heros inital location and doesnt update movement... Ill look at teh file and see if that works. Thanks
  • SBorgstromSBorgstrom Member Posts: 3
    Thanks Socks that works but is there another way of setting the velocity as the enemy is fast when far away and then slows down close to hero... would rather have enemy have a constant velocity
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2014
    @SBorgstrom
    Thanks Socks that works but is there another way of setting the velocity as the enemy is fast when far away and then slows down close to hero... would rather have enemy have a constant velocity
    Hmmm . . . . good question, maybe use magnitude to measure the distance . . . then subtract a percentage of that distance value from the velocity . . . so if the distance is large - say 100 pixels - you take away a lot of speed, and if the distance is small - say 5 pixels - you take away only a small amount of speed.
Sign In or Register to comment.