1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

GMS 2 (Solved) Getting negative value for point_direction?

Discussion in 'Programming' started by Biosyn, Feb 2, 2019.

  1. Biosyn

    Biosyn Member

    Joined:
    Oct 17, 2017
    Posts:
    43
    Hi,

    I've tried googling for a solution, but can't find it. I'm basically just trying to get my angle variable for an AI pointer object to get negative values. Ideally, it'd be preferable to use point_direction which afaik only shows an angle value between 0 and 359 inclusive. I'd like the function to get values between -90 and +90 inclusive when the pointer object is facing right.

    I tried clamping with a negative value, as well as trying to set the angle to 360-point_direction(...) but neither worked.

    Would appreciate any input!
     
  2. TheSnidr

    TheSnidr Heavy metal viking dentist GMC Elder

    Joined:
    Jun 21, 2016
    Posts:
    473
    Look up a function called angle_difference :)
     
    Biosyn and Edwin like this.
  3. Biosyn

    Biosyn Member

    Joined:
    Oct 17, 2017
    Posts:
    43
    Thanks TheSnidr for pointing the right direction!
    I'll take it from here.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice