Tuff to answer: Getting Actor B to move towards Actor A
GingerBGames
Member Posts: 390
Hello GS'ers,
I have two actors, Actor "A" and Actor "B". A is controlled by a left and right joystick. Left stick is for moving, and Right stick is for angle (or for turning your character to face the way you want to walk). I'm trying to get B to move towards A. I've done that. Here's my problem. Actor A moves around on the scene. Actor B is always facing the same way. If actor A starts on the North end of the map, Actor B moves towards him from the East (with his eyes facing actor A to the West), actor A moves to the South, Actor B moves towards him, with his eyes still facing west. Can I have B move and angle himself so he's always facing A?
I hope I explained this well, i'm kinda confused by it. Sorry, if it's sounding weird.
Title edited by BeyondtheTech: please try to keep your thread titles descriptive for everyone's benefit. Thanks!
I have two actors, Actor "A" and Actor "B". A is controlled by a left and right joystick. Left stick is for moving, and Right stick is for angle (or for turning your character to face the way you want to walk). I'm trying to get B to move towards A. I've done that. Here's my problem. Actor A moves around on the scene. Actor B is always facing the same way. If actor A starts on the North end of the map, Actor B moves towards him from the East (with his eyes facing actor A to the West), actor A moves to the South, Actor B moves towards him, with his eyes still facing west. Can I have B move and angle himself so he's always facing A?
I hope I explained this well, i'm kinda confused by it. Sorry, if it's sounding weird.
Title edited by BeyondtheTech: please try to keep your thread titles descriptive for everyone's benefit. Thanks!
Comments
Promote A's x/y position to game attributes (real)
Constrain B's rotation to vectorToAngle(Ax-Bx,Ay-By)