A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] [HELP] Rotate MC with Math?

  1. #1
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    86

    resolved [RESOLVED] [HELP] Rotate MC with Math?

    Hello mans, Happy Holidays.

    Good, I need to rotate player to the direction of a clicked point. I use this code to move the MC:
    Attached Files Attached Files

  2. #2
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    86

    resolved [SOLVED] Rotate MC to clicked point?

    Solved.

    Code:
    rotate=-(Math.atan2(_xmouse-player_mc._x, _ymouse-player_mc._y))*radiance;
    player_mc._rotation = rotate;

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center