Okay guys here it is teleportation “WITHOUT SCRIPTS”
2 things you need to know.
How to make a collision in the game engine for 3 objects and
How to switch cameras using logic blocks.
Teleportation has been an issue with Blender.
In reality, instancing is just the use of Camera switching between scenes. And fortunately, it can be easily done with the logic blocks.
And unfortunately for all of you 2.4x folks, this tutorial is in Blender 2.5 !
First set up 4 scenes.
Make sure each scene is in “Blender game” mode -which is set in the menu beside the scene selection menu. ( If you don’t do this for EACH SCENE, you will not be able to instance your scenes, nor will you be able to add game physics)
Label each scene as something you can remember because you will be switching back and fourth a lot.
- Scene (default)
2 Scene2 2boy
- Scene3 3boy
4 Scene 4 4boy
Or you can use any names you wish for your 4 scenes.
In each scene have a plane(mesh) and a sphere (mesh) and a camera.
So you will be creating 4 cameras 4 planes and 4 Spheres.
Position the sphere about 4 blender units above the sphere so that when you trigger a collision you can see it clearly.
Be sure to position your camera so that you can clearly see the collision happen from the camera’s point of view when ever you push “P”!
Now IN EACH SCENE-- parent the camera of that scene to the sphere of that scene.
You must do this because you want the camera to sense the collision of the sphere (mesh) and not necessarily of the Camera itself.
Next set your collision for the sphere and the plane in each sphere.
Just go to the physics tab with your sphere selected and set it to rigid body.
Then check the collision bounds box(leave it as the default settings)
Next select your parented camera an set it to rigid body as well in the physics tabs.
Then check its collisions bounds and leave it as the default bounds settings.
Do this for each and every scene.
Then select your plane and set it to static. be sure to check the collision bounds box and leave it as the default setting.
Do this for each and every scene. So you will be doing this 4x for 4 separate scenes.
The result will be the sphere dropping(and bouncing) onto the plane when you press “P” In all 4 scenes…
THE MAGIC of TELEPORTATION aka Instancing:
In scene 1 ( your first scene)
1 Select your camera(only) open 2 sensor blocks name each of them as “COLLISION”
2Open 2 Controller blocks and leave them as “AND”
3 Open 2 Actuator Blocks and set the first one to “CAMERA” then set the OB: to "Camera.001 ( this should be the camera ID of your second scene) Leave everything else in this block alone.
Set the second Actuator block to “Scene” then choose ‘Set Scene’ in the menu.
then type in the “Scene ID” of your second scene. Leave everything else alone.
-
repeat steps 1-3 for your sphere mesh in this scene.
-
Go to your second scene. Apply simple collisions to your sphere, plane and camera as you did in your first scene. ( again if you aren’t in “Blender game” this will not be possible)
In scene 2 ( your second scene)
1 Select your camera(only) open 2 sensor blocks name each of them as “COLLISION”
2Open 2 Controller blocks and leave them as “AND”
3 Open 2 Actuator Blocks and set the first one to “CAMERA” then set the OB: to "Camera.002 ( this should be the camera ID of your third scene) Leave everything else in this block alone.
Set the second Actuator block to “Scene” then choose ‘Set Scene’ in the menu.
then type in the “Scene ID” of your third scene. Leave everything else alone.
-
repeat steps 1-3 for your sphere mesh in this scene.
-
Go to your third scene. Apply simple collisions to your sphere, plane and camera as you did in your second scene. ( again if you aren’t in “Blender game” this will not be possible)
At this point you should go back to your first scene and push “P” to test it out.
If you teleport to the next scene then you got it right.
Also experiment with moving once you get into the next scene. This is done of course by additional basic logical block x,y,z, assigning to the sphere mesh.
If you want, you can repeat this process forever with more and more scenes. Thus we now have instancing . You can also loop this method by setting the fourth seen to instance back to the first scene (theoretically).
Now I will test this theory out further; and depending on the capacity of a single scene, we will know how far we can actually push the BGE. If it continues to work well, then that means the BGE won’t get cluttered with high res meshes. Thus, we can have better game graphics by strategically and wisely using this instance method, and we don’t need Scripts.
Happy Blending.