Magnitude slows to a stop.

dre38wdre38w Member Posts: 79
edited November -1 in Working with GS (Mac)
I'm using the Move behavior and I'm using vectorToAngle as the direction and magnitude as the speed to get to a certain spot. Although, my problem with this is it slows to a stop when it reaches the destination. Which I do not want. I've been at this for a little bit. How in the world do I fix this?

Comments

  • msonesmsones Inactive, Chef Emeritus Posts: 75
    Magnitude measures the distance between the actor and a particular spot. If you're using magnitude for speed, your speed will decrease as the distance decreases. If I'm understanding you correctly, you don't want your speed to decrease; you want a constant rate of speed until the actor reaches the spot.

    One way to do this is use a constant speed in your move behavior (say, 100; change as needed), and then place the move behavior inside a rule that states "when actor.position.x DOES NOT EQUAL [x position of desired location] AND actor.position.y DOES NOT EQUAL [y position of desired location], then [move behavior].

    Alternatively, use the "move to" behavior. Move To causes the actor to stop upon arrival.
  • dre38wdre38w Member Posts: 79
    Thank you! I actually did some more messing around and ended up using Move To. And took out vectorToAngle and magnitude all together. Now that worked fine to an extent.

    I'm using waypoints and when the character gets to a waypoint it goes back to its original position. Which is odd because I told it to go to game X and Y which is constrained to the position of the current waypoint. Did some debugging and the X and Y is indeed changing to the current waypoint's position. Yet the character still moves to its original position before moving to the next waypoint. And then even after the last waypoint it will go to its original position again. More or less its original position.

    I'm still messing around but if anyone knows what's up with it do please let me know. Thank you!
  • dre38wdre38w Member Posts: 79
    Well that's weird. I shut down, went home, opened up Gamesalad again and will you look at that, it works now. Don't know what I did different but problems are solved now. Thank you!
Sign In or Register to comment.