ContainerRayCast() Doesn't work on forestItem s - NOT A BUG
by BryceSquared · in Torque 3D Professional · 12/10/2010 (7:03 am) · 1 replies
using this code
i couldn't get the raycast to hit the tree.
I stepped through in Torsion and it seemes it doesn't find a ForestObjectType which afaik is the typemask i need to use.
Thanks.
function PlayGui::onRightMouseDown(%this, %pos, %start, %ray)
{
%start = VectorScale(%ray, 2000);
%end = VectorAdd(%start, %ray);
%scanTarg = containerRayCast(%start, %end, $TypeMasks::ForestObjectType);
if (%scanTarg)
echo(%scanTarg);
}i couldn't get the raycast to hit the tree.
I stepped through in Torsion and it seemes it doesn't find a ForestObjectType which afaik is the typemask i need to use.
Thanks.
Torque Owner BryceSquared
Default Studio Name
function PlayGui::onRightMouseDown(%this, %pos, %start, %ray) { %ray = VectorScale(%ray, 2000); %end = VectorAdd(%start, %ray); %scanTarg = containerRayCast(%start, %end, $TypeMasks::ForestObjectType); if (%scanTarg) echo(%scanTarg); }changing to solves the problem. I probably need to go to bed zzzz.
EDIT: Although that still doesn't do what i want it to do as it doesn't point me to the exact tree that i clicked on. Has anyone done anything like this?