I want it to be on “just activated” when I click. I looked at the documentation and it said that queue can contain “bge.logic.KX_INPUT_JUST_ACTIVATED” and “bge.logic.KX_INPUT_JUST_RELEASED” right now it does both. Anybody know what to do?
Hint:
It would be simpler to use a sensor [mouse sensor in button mode].
When there is just one sensor and True Level Triggering is disabled you can safely assume the controller is only executed when the sensor just switched evaluation state (either from False to True or from True to False).
If I was going to do it with python, how would I? I checked status and it said it can contain only input active and no input. Could you give me a example of how to make the mouse just activated?
import bge
keyStates = bge.logic.mouse.events
# look up the state of a specific key:
leftMouseButtonState = keyStates[bge.events.LEFTMOUSE]
# evaluate the state and extract the information you want to know
isLeftMouseButtonPressed = (
leftMouseButtonState == bge.logic.KX_INPUT_JUST_ACTIVATED or
leftMouseButtonState == bge.logic.KX_INPUT_ACTIVE)
print( isLeftMouseButtonPressed )