Change scene but keep view the same?

Hello all.

I have a very simple file with a character in it: http://www.pasteall.org/blend/34342

In order to have two versions of a collision mesh, I would like to change scenes when I press a key (S in this case). The idea is that in one scene the mesh detects collisions but in the other it doesn’t, so that I can walk through it.

But when I press S, the view changes. I want everything to stay the same, just the non-collision version of the mesh to be brought in via a new scene.

Any idea what I’m doing wrong? Or is there a better way to accomplish what I am after?

Thanks.

You have two scenes. They are different. They have no relation to each other unless you create one.

Your request is similar to the “I want to return to the scene and it should look like as I left it” - requests.
If you really want that -> look for save/load systems. They can store and restore the state of a scene. If they are flexible they can even restore a scene state to a different scene (with different object names).

Towards you real request:

Yes indeed:

A) look at collision mask … I never used it so I can’t tell anything about it, but it sounds worth to look at it
B) replace the mesh with another (the physics mesh not the display mesh … there is a switch in the replace mesh actuator)
Hint: Enable Menu/Game/Show Physics Visualization to see the effect
C) replace the complete object … addObject/endObject in the EditObjectActuator

Or you can keep a unique scene and use edit object actuaor>dynamics>suspend dynamics… If I understand what you are trying to achieve. (oh sorry, it seems that does not work)

Or is there a better way to accomplish what I am after?

If I understand correctly, I would simply put the other mesh on an inactive layer. (Not a Scene) So that when you press “S” one mesh ends, and the other is spawned.

First off, thanks for the responses everyone. Monster’s in particular set me off in some useful directions …

A - Could work, but I can’t change the collision mask via BGE. Agoose77 has a patch that allows that via Python, apparently, but it isn’t committed (yet). Just asked him on IRC.

B - I can’t get this to work properly. The mesh replaces but the physics stays the same (i.e. still detects collisions), even with the ‘phys’ button ticked and with different collision groups/masks. Example file here (press ‘A’ to replace the mesh): http://www.pasteall.org/blend/34372. Edit: I get it now. The physics mesh (i.e. the shape of the mesh that will be used to determine collisions) is replaced, but the object remains the same, along with all its physics settings (like ghost).

C - This works. Just means that I need two versions of every mesh, but I can live with that.

So it looks like C is a decent workaround for me. Solved!

Thanks again.