Anyone else experienced difficulties with "Move To" and actors flying off the screen?
flurospeedo
Member Posts: 33
My current project makes heavy use of the "Move To" behaviour. However, I am experiencing intermittent faults when previewing the game in Preview Player whereby the actor instead of stopping at the point specified in the "Move To" instead continues on the trajectory and off the screen. I am unable to consistently replicate the fault and simply stopping and then re-running in the Preview Player often results in the actor behaving normally.
This has been occurring since I began on the project but has started to reach epidemic proportions today, with actors flying off the screen far more frequently. Has anyone else experienced this? Is the fault merely in the Preview Player and my final published game will behave normally? If not can you suggest a solution?
This has been occurring since I began on the project but has started to reach epidemic proportions today, with actors flying off the screen far more frequently. Has anyone else experienced this? Is the fault merely in the Preview Player and my final published game will behave normally? If not can you suggest a solution?
Comments
If you have a High rate of speed, I think it can sometimes overshoot your destination
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
What you could do is make a Threshold attribute and give it a value like 5 or so.
So when game.Threshold < magnitude(self.position.X-self.targetX,self.position.Y-self.targetY)
Then Move To (self.targetX, self.targetY)
That way it doesn't matter which way the actor is coming from the target point. If you are working with one dimension, then it is even easier.
When game.Threshold < abs(self.position.X-self.targetX)
Then Move To (self.targetX, self.Position.Y)
or something like that.