Jump to content

GetHeadingAngle equivalent for X axis?


Hopper31

Recommended Posts

I don't think there's an equivalent function. The following should work (assuming you've already set the z angle), but trig functions are slow so this might not be practical to run every frame, particularly on slower PCs.

FLOAT Hypotenuse
FLOAT Opposite
FLOAT Fraction
FLOAT Angle

Set Opposite to (targetREF.Getpos z - npcREF.GetPos z)
Set Hypotenuse to npcREF.GetDistance targetREF
Set Fraction to Opposite / Hypotenuse
Set Angle to Sin Fraction 1
Link to comment
Share on other sites

 

Set Opposite to (targetREF.Getpos z - npcREF.GetPos z)
You would want to switch places here, as the X angle is negative when looking up:
Set Opposite to (npcREF.Getpos z - targetREF.GetPos z)
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...