Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name EYEANGLES_FIXED
- @inputs
- @outputs TrueY Y
- @persist
- @trigger
- if(first()){
- function number fromNorth(X){
- if( (X - 90) > 0 ){
- return 360 - (X - 90) # we deduct that from 360 to change it from anti-clockwise to clockwise.
- }else{ # X - 90 is to make it start North rather than East
- return 360 - (270 + X) # this is to fix the 1st "quadrant" - East to North in our original, now is 4th quadrant.
- }
- }
- function number to360(X){
- if(X >= 0){
- return fromNorth(X) #as said in reddit post. from east to west it doesn't need adjustments
- }else{
- return fromNorth( abs(X) + (180 - abs(X))*2 ) #here's where it gets tricky, so i made something in paint:
- } #https://i.imgur.com/9wAlWup.png
- }
- }
- interval(15)
- Angle=owner():eyeAngles()
- Y = to360(Angle:yaw())
- TrueY = Angle:yaw() #use the debugger to see these two values
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement