Problems With Move To command

TwilightHunterTwilightHunter Member Posts: 146
edited November -1 in Working with GS (Mac)
Heyya, I have an issue here.. I'm using Move To for an actor to move towards the X and Y of another actor I constrained the X and Y to. So:

-Move To:
global.PlayerX
global.PlayerY
Speed: 100 (Whatever)

Now this works fine (obviously) but my problem is once they hit that X and Y coordinate. They stop following it, even if the other actor moves. How do I make them follow the X and Y always, even after they've hit it once?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi TwilightHunter; you have to use the Constrain Behaviour always if you want your actor to always follow another.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • TwilightHunterTwilightHunter Member Posts: 146
    ahhh ok... That's not really going to work seeing as it's top down view and the actor it's following is rotating so I don't know exactly what angle it's going to be at. Thanks anyway.
    Also, is there a way to have a clean movement in the direction the actor is rotated? Right now I'm using accelerate, but the actor "Accelerates" in the direction it's rotated in so it takes more than a few seconds to move in the correct direction.
  • TwilightHunterTwilightHunter Member Posts: 146
    Forget the last question, I'm now using velocity for that.
    My collision isn't working on some of my actors though. See I have 4 actors. The main piece, Piece 2 (follows main piece), Piece 3 (Follows piece 2), Piece 4 (Follows Piece 3)

    The main piece can collide with the other pieces, this means they can't ever hit the X and Y they're following, so they never stop. But on the other Pieces I want them to collide with each other, so I dropped in the collide behavior for each piece, and nothing happens. It works with the main piece, but I'm guessing this is because it's moving on it's own, whereas the other pieces are "Moving To" the X and Y, and it's somehow canceling out my collision.
  • TwilightHunterTwilightHunter Member Posts: 146
    Oh my lord... It was just glitched. I just deleted the actors out of the scene and replaced them back in. Whatever, thanks anyway!
  • TwilightHunterTwilightHunter Member Posts: 146
    If anyone wants to know, there is a very simple fix to this Move To problem. On the actor you want to follow the player (or whatever actor you've made a global x and y for) just say on it's move To command:
    If self.Position X is not equal to global.Player X
    If self.Position Y is not equal to global.Player Y

    Move to
    global.Player X
    global.Player Y
    speed 100 (or whatever speed)

    This will make it always follow the player, and not just stop once it gets there
Sign In or Register to comment.