@name Guiding Arrow
@inputs Path:array
@outputs C Count XYZ:vector
@persist C Count
@trigger 
runOnTick(1)
H1="pyramid"
#H1="prism"
O=owner()
E=entity()
Height=70
Ori=O:pos()+O:forward()*100
Hpos=Ori+vec(0,0,Height)
Blue=vec(0,128,255)
Color=Blue
Count=Path:count()
Red=vec(255,0,0)
Hide=0
if(first()){
    holoCreate(1,Ori+vec(-15,0,Height),vec(1,1,1),ang(-90,0,0),Color)
    holoCreate(2,Hpos,vec(2,0.5,0.5),ang(),Color)
    holoModel(1,H1)
    holoAlpha(1,128)
    holoAlpha(2,128)
    holoParent(1,2)
    if(Hide){
        holoVisible(1,players(),0)
        holoVisible(2,players(),0)
        holoVisible(1,O,1)
        holoVisible(2,O,1)
    }
    
}else{
    if(Count&changed(Count)){C=1}
    if(Count){
        XYZ=Path[C,vector]
    }
    holoAng(2,(Hpos-XYZ):toAngle())
    holoPos(2,Hpos)
    if((O:pos():distance(XYZ)<70)&C!=Count){C++}
    if(C==Count){
        holoColor(1,Red) 
        holoColor(2,Red)
    }else{
        holoColor(1,Blue)
        holoColor(2,Blue)
    }
}

