Show mouse script?

Can someone tell me how to show the mouse in-game?


If you use a recent version of blender, you can go to the Render options and under the Display tab you will find a checkbox for mouse cursor.

If you want to do it by python you can use the following:

import bge

Thank you!

I tried doing bge.render.showMouse(True), still no success, and the script doesn’t show any errors on the console.

you can do this using logic brick pretty easily.

here is a example where the mouse cursor visibility is toggled when space bar is pressed.

(BGE 2.79)

Both integer or boolean values for bge.render.showMouse() seem to work fo rme in UPBGE 0.2x and UPBGE 0.3.
What OS are you using?
Are you sure your script is being run? Have you tried using print() functions to verify your script is running?

I made sure it was running, but I didn’t know the logic bricks could be used for showing the mouse, which worked better for me. I’m using Windows.