Finding rotation

BrundiBrundi Member Posts: 60

Hi, I have been wondering how to set an actors rotation to face another actors position. For example if the actor is above actor then I want actor's rotation to face upward and the same for all detections.

Thanks, Brandon

Best Answer

  • opaopa Posts: 35
    Accepted Answer

    Constrain self.rotation to vectortoangle(self.position.x-otheractor.x and self.position.y-otheractor.y)

    If you want smoother rotation or if you want to use collisions etc, use rotate instead of constraining.

    Not 100% sure about this because I can't test it right now, but take a try. :smile:

Sign In or Register to comment.