Adjusting UnitFacing for 'Arc Movement' - (SetUnitAnimation)

Fulla

Evil Overlord
Reaction score
31
I'm working on a projectile spell that moves in an Arc up then down, like this:
Arc.jpg


Im hoping to make the projectile's angle/facing adjust with the Arc.
Currently this is what it looks like/happens (pretty ugly):
A2-3.jpg


What I'd hope it will look like eventually:
A3-2.jpg


In iNfraNe's Particle System, it was done with vectors like this:
JASS:
set j = R2I(Atan2BJ(udg_vectorZ[v], SquareRoot(udg_vectorX[v]*udg_vectorX[v]+udg_vectorY[v]*udg_vectorY[v]))+0.5)+90
call SetUnitAnimationByIndex(u, j)


Note the missile is a Dummmy model that has multiple animations for setting its angle/facing.
  • What mathmatical figures are needed to adjust it properly?
    Is Speed, Height, Angle, X, Y enough?
  • What formula can correctly set the animation / facing?

I had a little try, but failed:
JASS:
set aoa = R2I(Atan2BJ(GetUnitZ(dat.missile), SquareRoot(x * x + y * y)) + 0.5) + 90
call SetUnitAnimationByIndex(dat.missile, aoa)


thx for any help
 

Viikuna

No Marlo no game.
Reaction score
265
Is that model using degrees? I mean does it have 360 animations or what?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top