@name Hover Platform
@inputs Scale
@outputs 
@persist Con:entity Box:vector
@trigger 
if(first())
{
Con = entity():isConstrainedTo(1)
Box = Con:boxSize()
holoCreate(1)
holoCreate(2)
holoCreate(3)
holoCreate(4)
}
runOnTick(1)
ForRight = Con:toWorld(vec(-Box:x()/2,Box:y()/2,0))
ForLeft = Con:toWorld(vec(-Box:x()/2,-Box:y()/2,0))
BackLeft = Con:toWorld(vec(Box:x()/2,-Box:y()/2,0))
BackRight = Con:toWorld(vec(Box:x()/2,Box:y()/2,0))

if(rangerOffset(ForRight,ForRight-vec(0,0,100000)):distance() <50)
{
    Con:applyOffsetForce(vec(0,0,3)*Con:mass(),ForRight)
}
else
{
    Con:applyOffsetForce(vec(0,0,1)*Con:mass(),ForRight)
}

if(rangerOffset(ForLeft,ForLeft-vec(0,0,100000)):distance() <50)
{
    Con:applyOffsetForce(vec(0,0,3)*Con:mass(),ForLeft)
}
else
{
    Con:applyOffsetForce(vec(0,0,1)*Con:mass(),ForLeft)
}

if(rangerOffset(BackLeft,BackLeft-vec(0,0,100000)):distance() <50)
{
    Con:applyOffsetForce(vec(0,0,3)*Con:mass(),BackLeft)
}
else
{
    Con:applyOffsetForce(vec(0,0,1)*Con:mass(),BackLeft)
}

if(rangerOffset(BackRight,BackRight-vec(0,0,100000)):distance() <50)
{
    Con:applyOffsetForce(vec(0,0,3)*Con:mass(),BackRight)
}
else
{
    Con:applyOffsetForce(vec(0,0,1)*Con:mass(),BackRight)
}

Con:applyAngForce(-Con:angVel()*Con:mass())
