Changing camera translation, but.....

Hey!
First things. I have used the walkthrough template to start me off on my first attempt at an interactive walkthrough. However i would like to know if the following can be done.
I have set a plane with the logic properties of ‘mouse over and left mouse button’ to jump to a new scene, which it does fine. So there is my translation bit and here is the but…
I would like to take the last known rotations of the mouse before the scene jump and apply it after the jump, so that the camera is facing in the right direction. I need this to be dynamic, so that it does not require a new scene for every eventuality.

Is this possible? ( i’m only half way through the first python tutorial and have just got to creating functions)
Apologies if i have just confused everyone

when you click on the plane make it send a message with the subject “Get_Ori” or something like that

and on the camera a message sensor for whatever you named it

going into this script


#Startup Stuff
import GameLogic as g
cont = g.getCurrenController()
own = cont.getOwner()

#Get The Cameras Orientation as the Global Variable "g.Cam_Ori"
g.Cam_Ori = own.getOrientation()

and in the new scene on the camera an always sensor no pulse mode
going into this


#Startup Stuff
import GameLogic as g
cont = g.getCurrenController()
own = cont.getOwner()

#Set The Cameras Orientation From the Global Variable "g.Cam_Ori"
own.setOrientation(g.Cam_Ori)

that should work

Wow! thank you very much!

Thanks scabootssca. Unfortunatley, i couldn’t get it to work. The camera is a child of ‘shoulder’ ( with an ipo property of pitch associated with it) which itself is a child of ‘viewer’ ( with an ipo property of lateral rotation associated with it). Am i right in thinking that these are overiding the camera script?

To get the freelook camera i used the walkthrough template on blender3d.com

when you click on the plane make it send a message with the subject “Get_Ori” or something like that

and on the camera a message sensor for whatever you named it
going into this script on the “viewer” object connected to the ipo actuator on the “shoulder” object



#Startup Stuff 
import GameLogic as g 
cont = g.getCurrenController() 
viewer = cont.getOwner()
shoulder = cont.getActuators()[0].getOwner()

g.Viewer_Rot = viewer.rot
g.Shoulder_Pitch = shoulder.pitch


and in the new scene on the “viewer” object an always sensor no pulse mode going into this script on the “viewer” object connected to the ipo actuator on the “shoulder” object



#Startup Stuff 
import GameLogic as g 
cont = g.getCurrenController() 
viewer = cont.getOwner()
shoulder = cont.getActuators()[0].getOwner()

viewer.rot = g.Viewer_Rot
shoulder.pitch = g.Shoulder_Pitch


that should work
this time

:frowning: :-? I keep getting this output…

Traceback <most recent call last>:
File “get ori2a.txt”, line 7, in ?
AttributeError: ‘module’ object has no attribute ‘Viewer_Rot’

Any ideas?

Btw i have rehashed the freelook script, so it is just a cam parented to an empty, cam is ‘up down’. Empty is ‘left right’ done with motion actuators affecting a move property, rather than ipos (which i don’t know too much about)

Sorry about this and thanks for your time

that dosent matter it dors that on mine also
but it works on mine