Jump to content

Recommended Posts

Posted

Hi, is there a way on a trigger action that a static unit can be removed from the map?

-----------------------------------------------

Intel® Core™i7 Quad Core Processor i7-6700 (3.4GHz) 8MB Cache | 32GB HyperX FURY DDR4 2133MHz | MSI GeForce RTX 2070 ARMOR 8G |SSD 1TB 970 EVO Plus M.2

Posted
4 hours ago, TheTrooper said:

Hi, is there a way on a trigger action that a static unit can be removed from the map?

 

On trigger action you can either use the mission editor "destroy unit" (like StevanJ said with an explosion) or use a "do script" box and copy/paste this text (same destroy function but from script, that doesn't employ explosion but simply remove the static unit, named 'Static test' in my example ) :

 

if StaticObject.getByName('Static test') and StaticObject.getByName('Static test'):isExist() == true then
StaticObject.getByName('Static test'):destroy()
end

 

.miz example attached. (Static unit is removed after 2 second in mission)

test-despawn-static.miz

Posted
On 4/18/2021 at 12:15 AM, toutenglisse said:

 

On trigger action you can either use the mission editor "destroy unit" (like StevanJ said with an explosion) or use a "do script" box and copy/paste this text (same destroy function but from script, that doesn't employ explosion but simply remove the static unit, named 'Static test' in my example ) :

 

if StaticObject.getByName('Static test') and StaticObject.getByName('Static test'):isExist() == true then
StaticObject.getByName('Static test'):destroy()
end

 

.miz example attached. (Static unit is removed after 2 second in mission)

test-despawn-static.miz 5.73 kB · 2 downloads

Ah nice one. Thanks for that👍

-----------------------------------------------

Intel® Core™i7 Quad Core Processor i7-6700 (3.4GHz) 8MB Cache | 32GB HyperX FURY DDR4 2133MHz | MSI GeForce RTX 2070 ARMOR 8G |SSD 1TB 970 EVO Plus M.2

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...