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.
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 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.