• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[JASS] RemoveUnit doesn't remove unit

Status
Not open for further replies.
Level 21
Joined
Aug 21, 2005
Messages
3,699
I have no idea why, but RemoveUnit(unit) is not removing the unit. I'm using a dummy unit with lightning shield model (but I've tried other models too) because I'm attempting to make a light system where lights can be turned on and off.

The original idea was to simply hide the light unit when the lights are turned off, but the actual light doesn't disappear, so I couldn't use that.

So I'm trying to use RemoveUnit() now to remove the light unit. But... the light unit dummy is still there. The actual light effect is lowered but not completely removed upon using the RemoveUnit function, and the actual dummy unit is still there (drag-select over the area and you'll see a "frog" unit with a lightning shield model).

This is the jasscode where stuff goes wrong:
JASS:
method TurnOff takes nothing returns nothing
    call RemoveUnit(this.light)
endmethod
this.light does exist.

I honestly don't know what's wrong. Expiration timer, SetUnitState, KillUnit, nothing seems to work...
I've attached the map so you can test it in-game. The lever you see contains an icon to turn the lights on/off.

EDIT: I've found the problem.
 
Status
Not open for further replies.
Top