Blender 2.72 scene and mouse actuator

I thought the suspend scene actuator is supposed to pause a scene, including all logic operations within that scene. Is this wrong? I have a script that keeps running after I pause the scene, which is causing an undesirable effect. Can anyone confirm what is actually paused with the suspend scene actuator?

TP_FP template.blend

Sounds your Python code is executed by an object in an active (non-suspended) scene.

I thought about that, however there are only 2 scenes (main scene and HUD scene). I pause the main scene and add the HUD overlay scene, however the mouse look scripts in the main scene stay active so when I exit my HUD (menu) my cameras have moved with the mouse. I just did a simple test to ensure the scene pauses, which it does. Then I deactivated the overlay scene to test if the scripts are running while paused, which they don’t. It seems having the overlay scene causes several scripts in my main scene to stay active. I would appreciate if you could take a quick look and let me know if you spot something I am missing. Press “e” to open/close the HUD (menu), move the mouse, then close the menu. It may be a moot point though as I am trying to integrate the new mouse actuator in the 2.72 build.

I managed to get this template updated to use the mouse actuator in 2.72, but it still has the same problem. The main scene, which is definitely paused, still updates mouse position causing the undesirable effect. Is this a possible bug?

How do I pause?

The typical so called “mouselook” rely on the system mouse cursor, which by it’s nature will not stop when you suspend a scene.

Your description sounds as if the code is not prepared to skip a frame.

To recover, it would, for now, potentially be possible to save the mouse position every frame and then write it on load.

Press “e” to pause and open the menu.

The typical so called “mouselook” rely on the system mouse cursor, which by it’s nature will not stop when you suspend a scene.

Your description sounds as if the code is not prepared to skip a frame.

To recover, it would, for now, potentially be possible to save the mouse position every frame and then write it on load.

Thank you for the help, I will try these solutions on the mouse look scripts. If I understand, I need a way to save the cursor position before pausing and set that position before resuming.

Though I did notice that the mouse actuator in the 2.72 test build does something similar. Though the main scene is paused, moving the mouse causes the camera to “skip” to the new mouse position when you resume the scene. If this can be considered a bug, I will report it.

Add a small script to the same thing that triggers the resume scene, and flag it for high-priority (ie the flag on the actuator)

import bge
bge.logic.mouse.position = (0.5, 0.5)

Thanks Geoff, this works exactly as I had hoped. In hindsight, I realize I didn’t need to save the position, just reset it to the screen center. Thanks again.