Mouse Picking - stuck (newbie)

Camera Module
#inherited from the parent module:
#import math
#import pandac.PandaModules as panda

global picker, handler, pickerNode, pickerRay

def init():
		global picker, handler, pickerNode, pickerRay
		picker = panda.CollisionTraverser()
		handler = panda.CollisionHandlerQueue()
		pickerNode = panda.CollisionNode('mouseRay')
		pickerRay = panda.CollisionRay()	       #Make our ray
		pickerNode.addSolid(pickerRay)      #Add it to the collision node
		picker.addCollider(pickerNode, handler)
		taskMgr.add(pick, 'picker')

def pick(task):
	if base.mouseWatcherNode.hasMouse():
		mpos = mpos = base.mouseWatcherNode.getMouse()
		global pickerRay
		pickerRay.setFromLens(base.camNode, mpos.getX(), mpos.getY())
		global picker
		if handler.getNumEntries() > 0:
			print 'hit!'
	return Task.cont

This is what I have, as a sort of ‘picking’ module for my game.
(note that most modules have been imported in the ‘parent’ module)

I can’t seem to find any tutorials on this, so I have some questions:

  1. have i forgotten anything?
  2. I think I need to add stuff to my nodes, what?
  3. anyone know of any tutorials on this?

How about the “FeatureTutorials–Picking” sample program that is distributed with Panda? Or how about this page in the manual?


that tutorial is mostly what I got my code from, but it’s just an example. I think I should get there with your second link, thanks for that one.