How to pick a hud ? (Solved)


im trying to pick my menu buttons I don't know how to do it.

I tryed to use a ray with:

Ray mouseRay = new Ray( mouse.getLocalTranslation(), new Vector3f(0,0,-1) );
hudNode.findPick(mouseRay, pickResults);
for (int i = 0; i < pickResults.getNumber(); i++) {
// Woah! a button found!!

But I never find any button :(

My Nodes tree are:
- mouse

If you have some solution, please say me.
Zansk you

are you using bounding pick, if so are your buttons bounded ??

Bounding volumes do not work on object in ORTHO queue. If your button is in ortho queue, you need to compare the mouse screen location against button's world traslation.xy. When you do the comparison, you should take into account the button dimensions.

uops, zanks you lex, I didn't know it.