I did a few changes to your blend
- Renamed the objects in the scene (The object names didn’t match the ones addressed in the python code)
- Switched the python controller to module mode and rewrote the python code (That way you can place multiple functions inside one script and access the controller directly via the “cont” argument
- Added an overlayscene “Masterscene” with the corresponding pause / resume logic
You can pause and resume the scene by pressing the spacebar.
Sample.blend (450 KB)
Is saw you used dloc for movement. That way you “teleport” the object by the given amount of blenderunits ignoring the physics system which causes the playerobject to bounce off the walls since it gets teleported inside the obstacle.
I replaced the dloc with livV which adds a constant force to your player object.