Using datatype angle in calculations

denismoroz81denismoroz81 Member, BASIC Posts: 3

Hi, could you pls help. I constrained game attribute, say "angle1" to an actor's angle (type - angle, via vectorToAngle). Then when I tried using this game attribute, angle1, in calculations, incorrect result appeared. To check, I constrained another game attribute, "angle2" (type - tried both angle and real), to angle1, and appeared that they showed different results. Also when I multiplied angle1 by 1, zero appeared. The overall task is to calculate difference between angles of two actors.

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Can you copy and paste the expression you're using to determine the value of angle1?

    Is there a reason you're not using self.Rotation?

    A screenshot would be really helpful here...

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • denismoroz81denismoroz81 Member, BASIC Posts: 3

    A screenshot would be really helpful here...

  • denismoroz81denismoroz81 Member, BASIC Posts: 3

    A screenshot would be really helpful here...

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Sorry, I meant a screenshot of the actors... how they are arranged... but I think I get it from the rules you posted.

    The attribute game.manAng should have a value between 0 and 360 depending on where you place the actor. See the attached demo. You can drag the white rectangle around to change the value of the vector.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.