5 Replies Latest reply on Nov 2, 2011 10:52 AM by James Newton, ACP

    Make sprite face in direction of movement?

    Natalie Butler

      I know, I'm probably throwing a bunch of easy questions at you guys, but I really have nowhere else to turn to for Lingo help, and I do try to troubleshoot things myself first before I come here. I'm just not getting anywhere!

       

      Let's say I'm using the Random Movement and Direction behavior, but I want my sprite to rotate to face the direction it randomly moves - the endpoint of each randomly generated path. And of course, I don't want it to randomly rotate in that case, so I'd nix that part of the code (or change it to fit what I need).

       

      I'm assuming I would have to set a new value for pSprite.rotation under the mNewPath handler (under the if voidP (pPath) statement)? But I can't figure out how to tell it the rotation value. It'll be based on the vector that is set in mNewPath.

       

      Thanks so much.