Game Engine, Players & Web Plug-in, Virtual Reality, support for other engines
Moderators: jesterKing, stiv
- Posts: 3
- Joined: Fri Dec 07, 2012 8:00 pm
I have a game where I am using a MouseOverAny sensor to simply grab the name of the object the mouse is over. The code of my Python controller hooked up to this MouseOverAny sensor (as well as a MouseClick sensor) is:
Code: Select all
clicked = controller.sensors['MouseClick'].positive;
hitObject = controller.sensors['MouseOver'].hitObject;
if hitObject is not None:
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.
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?
Who is online
Users browsing this forum: Bing [Bot] and 3 guests