Page 1 of 1

Game Bug Query - MoveTo Velocity of 0 does not stop movement

PostPosted: Sun Jan 20, 2013 9:17 pm
by bamby1983
I came across a bug regarding the MoveTo function and wanted to check whether anyone else has faced it so far. Setting the MoveTo velocity of an actor to zero doesn't stop movement. The velocity decreased all the way until 0.1 when I was checking for lower speeds, but when I set the value to 0, the actor moved at what seems to resemble a velocity of 1.

Has anyone else encountered this sort of an issue?

Re: Game Bug Query - MoveTo Velocity of 0 does not stop move

PostPosted: Sun Jan 20, 2013 9:21 pm
by skydereign
That's a problem with gE, I presume it is there, so it doesn't have to keep calculating the proper path, and if you have the actor avoid, compute shortest path. You are supposed to stop an actor using MoveTo to move them to their position. I'll see if I can improve that for the next version of gE.

Re: Game Bug Query - MoveTo Velocity of 0 does not stop move

PostPosted: Mon Jan 21, 2013 4:52 am
by bamby1983
Thanks for the information.

Probably all that would be needed was to use an if-condition within the existing MoveTo code so that it did something on the following lines:

Code: Select all
if (velocity!=0) {
    // MoveTo function code
                      }


That way, if the velocity equals 0, it's as if the function did not execute as nothing happens. I manually coded this bit into my code and it works fine.