- Joined
- Aug 4, 2006
- Messages
- 357
Hey guys,
I'm currently working on a Jump system. Once the unit is in the air, I want it to be targeted as a flying unit, so that ground units can't hit it while it's 50 feet in the air. Once the unit comes back down, it should be treated as a ground unit.
Now my question is: Is there a way to change how a unit is targeted in-game, without replacing it with another unit? I tried doing:
and that didn't seem to work.
Edit: I did some debugging using IsUnitType, and neither of the above function calls do anything. Even if I could manage to change the unittype, I don't know if this would affect how the unit is targeted.
I'm currently working on a Jump system. Once the unit is in the air, I want it to be targeted as a flying unit, so that ground units can't hit it while it's 50 feet in the air. Once the unit comes back down, it should be treated as a ground unit.
Now my question is: Is there a way to change how a unit is targeted in-game, without replacing it with another unit? I tried doing:
JASS:
call UnitRemoveType(u, UNIT_TYPE_GROUND)
call UnitAddType(u, UNIT_TYPE_FLYING)
Edit: I did some debugging using IsUnitType, and neither of the above function calls do anything. Even if I could manage to change the unittype, I don't know if this would affect how the unit is targeted.