@name RTCam
@inputs 
@outputs 
@persist O:entity EyeAngles:angle
@trigger 

if( dupefinished() ){ reset() }

if(first()){
    runOnTick(1)
    
    O=owner()
    Spot=O:shootPos()+O:forward()*15+O:right()*10+O:up()*5
    
    H = holoCreate( 1, Spot, vec(), O:eyeAngles() )
    holoParent( 1, O )
    
    Offset=vec(40,-20,15)
    
    holoCreate(2,H:toWorld(Offset),vec(0.1,10,10)*0.1,H:angles())
    holoMaterial(2,"models/rendertarget")  
    holoDisableShading(2,1)
    holoParent( 2, 1 )
     
    #holoParent(1,O)
}

EyeAngles=O:eyeAngles()
Angle = toWorldAng(vec(),ang(-EyeAngles[1]*1.5,0,0),vec(),EyeAngles)

holoPos(1,O:shootPos()-Angle:forward()*min(0,EyeAngles[1]))
holoAng(1,Angle)
