Rotate toward actor

dshoedshoe Member Posts: 62
edited November -1 in Working with GS (Mac)
How would I make one actor rotate to face another actor?

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    For the purpose of this....Player = rotate, Block = what you want to rotate toward

    You will need to take note of the Blocks X Y position.

    Make 2 real attributes call them positionX positionY or whatever you want.

    do a change attribute positionX to self.position.X same for Y in the block actor.

    Then in the player actor do rotate to position positionX positionY in the 2 boxes for X & Y.

    Make sure your image for the rotating actor is facing right if its a rocket/missile sprite for eg the warhead is on right the tail/fins on left and it will work fine.

    Darren.

    So
Sign In or Register to comment.