@name
@inputs 
@outputs 
@persist Pos:vector Dist
@trigger 

interval(10)

if(first())
{
    Dist = 25
    Pos = entity():pos()
    Size = 2
    Model = "hqcylinder"

    holoCreate(1)
    holoScaleUnits(1,vec(50,50,0))
    holoPos(1,Pos + vec(Dist,0,0))
    holoAng(1,ang(90,0,0))
    holoColor(1,vec4(255,255,255,128))

    holoCreate(2)
    holoScaleUnits(2,vec(50,50,0))
    holoPos(2,Pos + vec(-Dist,0,0))
    holoAng(2,ang(90,0,0))
    holoColor(2,vec4(255,255,255,128))

    holoCreate(3)
    holoClipEnabled(3,1)
    holoPos(3,Pos)
    holoAng(3,entity():angles())
    holoScale(3,vec(-Size,-Size,-Size))
    holoParent(3,entity())
    holoColor(3,vec4(0,128,255,255))
    holoModel(3,Model)
    
    holoCreate(4)
    holoClipEnabled(4,1)
    holoPos(4,Pos)
    holoScale(4,vec(Size,Size,Size))
    holoAng(4,entity():angles())
    holoParent(4,entity())
    holoColor(4,vec4(255,128,0,255))
    holoModel(4,Model)
}

if(holoEntity(3):pos():x() > Pos:x())
{
    holoClip(3,holoEntity(1):pos(),holoEntity(1):up(),1)
    holoClip(4,holoEntity(1):pos(),holoEntity(1):up(),1)
}
elseif(holoEntity(3):pos():x() < Pos:x())
{
    holoClip(3,holoEntity(2):pos(),holoEntity(2):up() * -1,1)
    holoClip(4,holoEntity(2):pos(),holoEntity(2):up() * -1,1)
}
