how to make unit unselectable (temporary)

Level 11
Joined
Jul 17, 2013
Messages
513
What i need to do is to make my hero not click able for 2 seconds, after 2 second passes unit can be clicked by player again. what i have tired is adding locust ability to my unit via custom script but the problem is my unit stays unselectable forever, even when i remove locust
1629848124735.png
 
Not sure if it works, but tried morphing it into an alternative unit with Locust?
Otherwise, hiding it and creating a temporary unit with locust?
That or hide and create a special-effect of the unit.
Note that you'll need to teleport away the special-effect before destroying it in order to avoid visible death-animation.
 

Uncle

Warcraft Moderator
Level 47
Joined
Aug 10, 2018
Messages
4,593
You MAY be able to pull a weird trick with Skins:
  • Set Variable YourUnit = some unit
  • Custom script: call BlzSetUnitSkin(udg_YourUnit, 'nzin')

That should set a unit's skin to the "zone indicator" model or whatever rawcode you plug in. I used the zone indicator since it's hidden/unselectable (unless already selected). Note that skins might cause unwanted side effects or desync crap.

This Action is only available on newer versions.
 
Top