Mouse - left button problem

Hello all.

I’m new to BGE and I found a problem trying to make a menu. The following description is based on the blend file I attached.

I want to be able to quit the game when I click over the monkey, so I added the logic to that object to do so. However, the game quits even if I click anywhere in the screen.

I added the same actuator (quit the game) to the cube but with a different sensor (Mouse over) and it works as I expected; that is, the game quits only when I put the cursor over the cube.

Could you help me understand this please?

Thanks in advance.

Note: I’m using Blender 2.49b


left-button.blend (166 KB)

add a mouse over sensor to the monkey, and connect it to the and controller. That way it needs a left click, and a mouse over the monkey to end the game.

What he said. :slight_smile:

I attached an example:


left-button.blend (166 KB)

Thanks, that works :slight_smile:

But I still find this behavior a bit odd :spin:

What do you find odd about it? there is a sensor to see if the mouse is over the object, then a sensor to see if the left mouse button is being clicked, both attached to an and sensor which activates the actuator only when all sensor connected to it are positive. It’s quite simple, but I guess it sound confusing when I explain it.

I would expect the Mouse-left button sensor to be activated only when I click over (when the cursor is over) the object to which I asigned the sensor to, the same way you do when you program applications that have graphical user interfaces, using other tools. I mean, I think the Mouse-left button sensor should detect the mouse over automaticaly.

Anyway, I guess it is needed to be this way for a reason I don’t know yet.

The way its set up now is very customizable. Think of a shooting game, where you need to left click to shoot.

or a menu. when you mouse over an item, it lights up(or something).