• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[vJASS] Some simple trouble with polar positioning

Status
Not open for further replies.
Level 4
Joined
Nov 7, 2009
Messages
83
JASS:
        local unit target = GetSpellTargetUnit()
        local unit caster = GetTriggerUnit()
        local integer level = GetUnitAbilityLevel(caster, SPELL_ID)
        local location dummy_right_pos = PolarProjectionBJ(GetUnitLoc(caster),100,-45)
        local real dummy_right_face = AngleBetweenPoints(GetUnitLoc(caster),dummy_right_pos)
        local unit dummy = CreateUnitAtLoc(GetOwningPlayer(caster),DUMMY_ID,dummy_right_pos,dummy_right_face)

I'm having trouble and I'm not sure if it is that I am writing something wrong on the code, if I am making a mistake on maths or if it is something else.

The code is actually quite simple, it's supposed to create a unit for some spell at a certain polar offseted distance from the caster and facing towards the caster, but I sometimes get the unit in the right place, sometimes not and it's always facing 0 degrees.
 
Status
Not open for further replies.
Top