However, in-game I can only get it to print out "Nothing hit!". Even when I click on a massive object in the game it still prints that out. I have the MouseOver controller set to TRUE level triggering with a frequency of 0 for a Mouse Over Any event in Pulse mode.
Code: Select all
clicked = controller.sensors['MouseClick'].positive; if clicked: hitObject = controller.sensors['MouseOver'].hitObject; if hitObject is not None: print(hitObject.name); else: print('Nothing hit!');
Is there perhaps a distance limit to this sensor? Maybe my objects are too far away? I tried moving the camera up close to my object and clicking, but it still printed out "Nothing hit!". What am I doing wrong?