Creating a beam between pos's...
by kc_0045 · in Torque Game Engine · 07/09/2004 (10:43 pm) · 0 replies
Hey im trying to make a function that well scale a "pole" to go between 2 pos but im having problems geting it to rotate right got any ideas? heres what i have so fare
setrealscale scales the object to take that much game room up. and i think you know what the other functions do :D well any help is wanted, thanks in advanced.
function make_beam(%pos1,%pos2)
{
%className = "StaticShape";
%dataBlock = beamdeployed;
%dir=0;//???
%range=VectorDist(%pos1,%pos2);
%beam = new (%className)() {
dataBlock = %dataBlock;
};
%beam.SetRealscale("0.5 0.5 "@%range);
%beam.setPosition(%pos1);
%beam.setRot(%dir);
echo(%dir);
}setrealscale scales the object to take that much game room up. and i think you know what the other functions do :D well any help is wanted, thanks in advanced.