So i'm trying to make a missile that when you use an ability then it spawns a dummy unit(missile) and that dummy unit follows the target unit of the ability,but my problem is when i use the ability then it spawns the missile,BUT the missile just stays in the place where it spawned,how do i fix that?,and also how can i make it MUI? or is it already MUI?
-
FireMissile
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Fire Missile
-
-

Actions
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




MissileMax_Index[1] Equal to 1
-
-



Then - Actions
-




Trigger - Turn on MoveExplode <gen>
-
-



Else - Actions
-
-


Set MissileMax_Index[1] = (MissileMax_Index[1] + 1)
-


Set MissileMax_Index[2] = (MissileMax_Index[2] + 1)
-


Set Missile_Shooter[MissileMax_Index[2]] = (Casting unit)
-


Set Missile_Target[MissileMax_Index[2]] = (Target unit of ability being cast)
-


Set Missile_Damage[MissileMax_Index[2]] = (Random real number between 300.00 and 420.00)
-


Set Missile_Loc[0] = (Position of Missile_Shooter[MissileMax_Index[2]])
-


Set Missile_Loc[1] = (Position of Missile_Target[MissileMax_Index[2]])
-


Set Missile_Angle[MissileMax_Index[2]] = (Angle from Missile_Loc[0] to Missile_Loc[1])
-


Set Missile_Active[MissileMax_Index[2]] = True
-


Unit - Create 1 Missile for (Owner of Missile_Shooter[MissileMax_Index[2]]) at (Position of Missile_Shooter[MissileMax_Index[2]]) facing Missile_Angle[MissileMax_Index[2]] degrees
-


Set Missile_Dummy[MissileMax_Index[2]] = (Last created unit)
-


Unit - Add a 2.50 second Generic expiration timer to Missile_Dummy[MissileMax_Index[2]]
-


Unit Group - Add Missile_Dummy[MissileMax_Index[2]] to MissileGroup
-


Custom script: call RemoveLocation(udg_Missile_Pos[udg_MissileMax_Index[2]])
-


Custom script: call RemoveLocation(udg_MissileTarget_Pos[udg_MissileMax_Index[2]])
-
-
-
MoveExplode
-

Events
-


Time - Every 0.03 seconds of game time
-
-

Conditions
-

Actions
-


For each (Integer MissileMax_Index[3]) from 1 to MissileMax_Index[2], do (Actions)
-



Loop - Actions
-




Unit Group - Pick every unit in MissileGroup and do (Actions)
-





Loop - Actions
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








Missile_Active[MissileMax_Index[3]] Equal to True
-
-







Then - Actions
-








Set Missile_Loc[0] = (Position of Missile_Dummy[MissileMax_Index[3]])
-








Set Missile_Loc[1] = (Missile_Loc[0] offset by 35.00 towards Missile_Angle[MissileMax_Index[3]] degrees)
-








Set MissileMax_Index[1] = (MissileMax_Index[1] - 1)
-








Set MissileMax_Index[2] = (MissileMax_Index[2] - 1)
-








Unit - Move Missile_Dummy[MissileMax_Index[3]] instantly to Missile_Loc[1], facing Missile_Angle[MissileMax_Index[3]] degrees
-
-







Else - Actions
-
-
-
-
-
-


Set Missile_Explode = (Units within 100.00 of (Position of Missile_Dummy[MissileMax_Index[3]]) matching (((Matching unit) is A flying unit) Equal to True))
-


Unit Group - Pick every unit in Missile_Explode and do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Distance between (Position of Missile_Dummy[MissileMax_Index[3]]) and (Position of (Picked unit))) Less than or equal to 100.00
-
-





Then - Actions
-






Unit - Add a 0.01 second Generic expiration timer to Missile_Dummy[MissileMax_Index[3]]
-






Unit - Cause Missile_Shooter[MissileMax_Index[3]] to damage (Picked unit), dealing Missile_Damage[MissileMax_Index[3]] damage of attack type Normal and damage type Normal
-
-





Else - Actions
-
-
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




MissileMax_Index[1] Equal to 0
-
-



Then - Actions
-




Set MissileMax_Index[2] = 0
-




Trigger - Turn off (This trigger)
-
-



Else - Actions
-
-


Custom script: call RemoveLocation(udg_Missile_Loc[0])
-


Custom script: call RemoveLocation(udg_Missile_Loc[1])
-
-

now its MUI 