if (mesh.intersectRay(GetRayFromPoint(x,y))) then
print('click mesh, do something...')
end

npantic

Joined: 12 Nov 2007

Posts: 19

Posted: Wed Nov 21, 2007 10:05 pm

Thanks!

This instruction also pushed me to ge more insigh in how to trigger scripts, etc.
I succedded to start the shot1 by clicking on the mesh in shot0, and on key press to stop the shot1!
I had some problems to "understand" end syntax (new to the lua, but have experience from Javascript, BlitzBasic, Actionscript, PHP... it is all the same )
I remembered to use Console for debugging, it is a must for a begginer...
I have a question: is there a way to make "Mesh Boundaries" smaller (indicated by green lines - selection) - to make onClick more accurate? I guess it is not the same as Movtar?

Vincent

Joined: 25 Dec 2006

Posts: 297

Posted: Thu Nov 22, 2007 3:23 am

Quote:

I have a question: is there a way to make "Mesh Boundaries" smaller (indicated by green lines - selection) - to make onClick more accurate? I guess it is not the same as Movtar?

For mobiles, ray intersection test is accurate to triangles.
For skinmeshs with bones animation, ray intersection test is accurate to bounding box. You can not change mesh's inner bbox, but you can get bbox to a variable, then change the variable and use bbox.intersectRay() to do intersection test.