Strange 'move to' error

In my game, i have an object that is supposed to home in on a certain location (400,79) on my screen, but for some reason, it wont stop on that coordinate unless the movement speed is above 178. If the speed is any lower, the object just passes through my coordinate without stopping. Thoughts?
I want the object to make contact another object to start a Collision function to reduce my Health attribute. My goal is to reduce health for every second the two are in contact, but I'm having trouble going about this..

Comments

  • Dima_HHDima_HH Member, PRO Posts: 48
    edited July 2013
    Don't use 'move to' behavior.
    Use 'Interpolate' it make the same just better ;)
    interpolate self.position.x to 400 and y to 79 in the same duration.
  • sak0213sak0213 Member Posts: 7
    Hmm, that sounded promising. I have a function that makes the object "die"(destroy) whenever linearspeed>-200. For some reason, using the interpolate function is initiating the destroy action
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    The move to doesn't always behave properly. Probably because it's never hitting the exact spot as a whole number add a range using equal to or greater than and equal to and less than.
Sign In or Register to comment.