Determining actor angle to face based on relative location of another actor?

Hi, I made a work around for this that was based on 8 directions. But this time, I want to appropiately determine an angle based on where the x,y location of an actor relative to the other actors position so that the other actor will rotate to face in that direction.

For example, if my main actor is in the center, and the other actor is to the upper right, then the main actor rotates to face in that direction, and if the actor goes to bottom, then the main actor rotates to face that angle.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Rotate To Position

    X = actor's X

    Y = actor's Y

  • FrantoFranto Member Posts: 779
    edited November 2014

    @Socks Thanks, I just learned about it first time today 10 minutes after my post, despite that fact it didn't show in search until after I posted this thread, how weird. I can't believe I did things the hard way all these months when Rotate to Position existed this entire time. :|

    Either way, I posted just in case my search lasted for more than an hour needlessly like with some previous problems that never got solved or answered. x _X

  • SocksSocks London, UK.Member Posts: 12,822
    edited November 2014

    @Franto said:
    Socks Thanks, I just learned about it first time today 10 minutes after my post, despite that fact it didn't show in search until after I posted this thread, how weird. I can't believe I did things the hard way all these months when Rotate to Position existed this entire time. :|

    You should invest a hour or so in looking through all the behaviours and playing around with them to see what they can do, there is even a little description that pops up when you click on each one, there are lots of pretty handy tools in the list, no need to struggle doing things the hard way :)

  • FrantoFranto Member Posts: 779
    edited November 2014

    Ok, I should do that now that I understand what most things mean, I think I did so early on in the year, but because I was a newb, most of it passed over my head.

    If you want to see the overly complicated system I made to determine projectile angle direction, pick Phreit, then in actual gameplay, click and hold the orange dude under the energy bar, a directional input thing will appear on screen. Clicking on the area of the arrow will set the angle of projectiles to fire in that direction. With "angle to pisition" the same thing can be achieved in a far simpler way AND at any angle, instead of being stuck using only 8 different angles.
    http://arcade.gamesalad.com/games/124663

    I guess its time to see what other stuff I missed. Thanks, Socks.

Sign In or Register to comment.