Move To issue

I see minor glitches in the Move To...which would not be acceptable for a commercial game.
It generally works ok (actor follows the touch), but sometimes the actor would 'jump' directly to the touch location rather than moving there gradually.
What would you recommend to be a better method to have an enemy follow the actor (that's 100% bulletproof)? I do need to check for collision as the actor is moving.

Thanks,
Adam

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I've heard Move To can be buggy. Another method is to constrain an angle attribute (e.g. game.enemyDirection) to vectorToAngle(enemyX-playerX,enemyY-playerY) and then have a Move behavior with game.enemyDirection in the direction box.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Yes move to is tricky business sometimes. It definitely takes finesse to use. You could also constrain the velocity of the enemy to the main actor. I'm not at my computer but I'll post the expression.
  • JScottJScott Member Posts: 143
    Did you try interpolate?
  • adamrnjadamrnj Member Posts: 19
    I heard interpolate may be better in terms of movement but won;t work with collisions. Is that true?
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Yes that is true
  • SocksSocks London, UK.Member Posts: 12,822
    @adamrnj
    I heard interpolate may be better in terms of movement but won;t work with collisions. Is that true?
    Interpolate a value from A to B - and constrain the movement to that interpolating value.
  • sulexk@gmail.comsulexk@gmail.com Member, PRO Posts: 21

    @Socks said:
    adamrnj I heard interpolate may be better in terms of movement but won;t work with collisions. Is that true?

    Interpolate a value from A to B - and constrain the movement to that interpolating value.

    Thank you :)
    LEGEND!

Sign In or Register to comment.