My character moves from the start point to the edge of a cave, I then change scenes to that of the cave. when he returns to the mouth of the cave, I change scene back to the village. The problem is I want to reposition my character when he emerges from the cave scene at the mouth of the cave.
I’m thinking message sensors, gameControl object to receive message and do repositioning for each scene. Is there a better way.
What I did was a added an empty that runs a script to position the character and globalDict. ie. In the cave, I set a property globalDict[“playerPosition”] to cave when I change scenes an object repositions the mesh depending on the value of globalDict[“playerPosition”]. I seems to be working fine, but if anyone has a better way, please post it.
This is the usual way of doing that (storing/restoring data). It comes usually with a load/save system. (Unfortunately the most SaveLoad developer forget that that it takes 2 steps to save a game “storing to memory” + “saving memory to disk”).
What you describe is the simplest form of store/restore. It forces you to place the scenes at the according positions that the positions fit together.
You might need an advanced version that adds an offset to the position (and the orientation).