@name Dolly Zoom
@inputs C:wirelink
@persist T O:entity
interval(10)

if(first())
{
    C["Activated", number] = 1
    C["Parent", entity] = O
    O = owner()
}


if(C:entity():type() == "gmod_wire_cameracontroller")
{
    print(4, "on")
    
    T++
    local Dist = 650 + (500 * cos(T))
    local Pos = O:shootPos() + O:eye()*Dist
    
    C["Position", vector] = Pos
    C["Distance", number] = Dist
    C["Zoom", number] = 90 / (Dist / 150)
    C["Angle", angle] = (O:shootPos() - Pos):toAngle()
}

