• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] negative roll angle stuffs

Status
Not open for further replies.
So heres my code:

JASS:
globals
    unit foot
    integer array unitType
    integer adder = 1
    integer current = 1
endglobals

function timerResults takes nothing returns nothing
    call RemoveUnit(foot)
    set foot = CreateUnit(Player(0),unitType[current],0,0,270)
    set current = current+adder
    if current>=5 then
        set adder = -1
    elseif current<=1 then
        set adder = 1
    endif
endfunction

function Trig_tiltingFoot_Actions takes nothing returns nothing
    local timer time = CreateTimer()
    set unitType[1] = 'h000'
    set unitType[2] = 'h001'
    set unitType[3] = 'h002'
    set unitType[4] = 'h003'
    set unitType[5] = 'h004'
    set foot = CreateUnit(Player(0),'h000',0,0,270)
    call TimerStart(time,.03,true,function timerResults)
endfunction

function InitTrig_tiltingFoot takes nothing returns nothing
    set gg_trg_tiltingFoot = CreateTrigger()
    call TriggerRegisterTimerEvent(gg_trg_tiltingFoot,1,false)
    call TriggerAddAction(gg_trg_tiltingFoot,function Trig_tiltingFoot_Actions)
endfunction

The units 'h000' through 'h004' are just footmen with different negative roll angles, this trigger is set up to make a unit appear to be 'tilting' back and fourth

But unfortunately after a few seconds of running the unit is replaced with one standing straight up and facing 0 degrees

Is this a bug in my trigger or?
 
Status
Not open for further replies.
Top