• 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] 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