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.