The best way for this you will need 2 targetnames for 2 layers of hexs so we can hide one and show the other or viceversa
The hide one we will need too is to make notsolid so the play fall down in case if stays for long time.
To spawn a trigger on every block you can use 2 for loops, one for the first layer and the other for the second.
The targetnames will work like a array so then you can use like this:
//layer1
for(local.i = 1;local.i <= $layer1.size;local.i++)
{
local.hex = $layer1[local.i]
local.trig = spawn trigger_multipleall
local.trig.origin = ( local.hex.origin )
local.trig setsize ( 0 0 0 ) ( 0 0 0 )
local.trig setthread hex_block
}
//layer2
for(local.i = 1;local.i <= $layer2.size;local.i++)
{
local.hex = $layer2[local.i]
local.trig = spawn trigger_multipleall
local.trig.origin = ( local.hex.origin )
local.trig setsize ( 0 0 0 ) ( 0 0 0 )
local.trig setthread hex_block
}
Before this code we will need to add a variable to each layer so we know wich one is hidden or show like this
$layer1.visibility = 0 // hidden
$layer1.visibility = 1 //show
Then on the thread of the trigger we put like this:
hex_block:
self nottriggerable // prevents the trigger to get triggerd very fast again
if($layer1.visibility == 0)
{
$layer1 show
$layer1 solid
wait 0.25
$layer2 hidde
$layer2 notsolid
$layer1.visibility = 1
$layer2.visibility = 0
}
else
{
$layer1 hidde
$layer1 notsolid
wait 0.25
$layer2 show
$layer2 solid
$layer1.visibility = 0
$layer2.visibility = 1
}
self triggerable // renable the trigger