@name hologram beam test
@inputs Grab:wirelink
@outputs Distance Division
@persist 
@trigger 
runOnTick(1)
E=entity():isConstrainedTo()
G=Grab:entity()
O=owner()
Point1=E:pos()+E:up()*((E:height()/2)+8.7)+E:forward()*-10
Point2=O:shootPos()
Distance=Point1:distance(Point2)
HoloCount=(Distance/600) #how many holograms do you need to reach Point2
HoloFloor=floor(HoloCount)+1
for(C=1,HoloFloor){
    P2P=((Point1-Point2)/(1+(HoloFloor-C)))+Point2  #get the mid point
    Ang=(Point1-Point2):toAngle()+ang(90,0,0) #rotate to face point1
   # if(C==HoloFloor){
        Size=vec(0.2,0.2,50*HoloCount)
    #}else{
    holoCreate(C,P2P,Size,Ang)
    holoModel(C,"octagon")
}

#holoCreate(-2,Point1)
#holoScale(-2,vec(1,1,1)*0.2)
#holoParent(-2,E)

#one holo unit is 12 units of measure, size max is 50 or 600 UoM



#[
    Scopes have been added. If you find any bugs,
    please report them on the forums.

    An option to copy with bbcode color syntax
    highlighting has been added (for use on forums).
    Right click anywhere in the editor to use it.

    Documentation and examples are available at:
    http://wiki.wiremod.com/wiki/Expression_2
    The community is available at http://www.wiremod.com
]#
