Moving consistently - how to move to a X,Y position but not stop

cibramcibram Member Posts: 7
edited July 2012 in Working with GS (Mac)
Hey everyone,

Imagine a top down game, an actor is spawning and taking Move To action which tells it to go to another actors X,Y position. So far i have done this with telling him to go local attribute.

But the actor stops when it goes to the X,Y - what i want is, it should move consistently and goes out of the scene.

Any suggestions?

Best Answer

  • JohnPapiomitisJohnPapiomitis Posts: 6,256
    Accepted Answer
    vectorToAngle(actorX-secondX,actorY-secondY)

    Theres alot of info on the forums about vectorToAngle, do a search if your still having trouble

Answers

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Make a attribute, change it to a vectorToAngle between the actors position and the x and y you want to move towards, and use change velocity behavior and use that attribute you made as the direction
  • cibramcibram Member Posts: 7
    hmm didnt get it, you have 4 things, actors x,y - and the x,y comes from attribute, but vectorToAngel(x,y) has 2.

    how can i find the angle to use in the direction? can you explain a little more?
Sign In or Register to comment.