MouseOverAny not working properly?

Game Engine, Players & Web Plug-in, Virtual Reality, support for other engines

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Fri Dec 07, 2012 8:00 pm

MouseOverAny not working properly?

Post by celestialorb » Mon Jan 21, 2013 6:05 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;
    if clicked:
        hitObject = controller.sensors['MouseOver'].hitObject;
        if hitObject is not None:
            print('Nothing hit!');
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?

Post Reply