Copy Camera to Overlay Scene

Hey everybody. I have a question!
Is it possible to copy a camera movement from one scene to another?
I want to use an overlay scene with some effects. My problem is, that the camera in the new scene doesn’t follow the original one.
Even when I make a link to that scene.

Does anyone know how to achieve this? Best without scripting, but if it is not possible scripting would be ok too :slight_smile:

Depends on what sort of effect you are trying to achieve… It might just be enough to give the camera in the overlay scene the same controls as in the main scene… It would help if we had a little bit more info to work with XD

yeah… sorry… ok… here is what i am trying to do.

I have a character in a Sidescroller… The camera is parented to my character with slow parenting. Now I want to have the exact same movement in my overlay scene. Just linking the camera into the scene doesn’t work, because I don’t have the character in that scene…
But I cannot link the character or the level itself into that scene too.

Since there is no direct link b/w 2 scenes, i dont think its possible without script but with python its just a few lines of code. I had written a similar script last yr. So wait a while while i find it.
EDIT: ok sorry i lost it :stuck_out_tongue: and since complete 1 yr. since i even touched python so cant do that right now. :stuck_out_tongue:
but its pretty easy if you know a lil python. just copy location and orientation of camera in first scene and pass it 2nd one using a variable. now you can just set the position & of camera of 2nd scene same as first one. DONE!

@modh.itqan
yeah… thats what I thought.
Does someone know how to copy the position of an object via python? and how to asign it to another object in a different scene? I don’t think it’s to hard… unfortunately I don’t know the syntax xD
I am not to familiar with coding :frowning:

You have but one choice… Search XD No really, it’s better that way. Just search the crap out of the forums. Rip all the relevant .blend files to shreds and put them back together again. You’ll probably fail at first but later on it won’t be so difficult.
I don’t know what version you are using but this tutorial is a favourite of mine.

Hmmm… Still you haven’t told us what effect you are trying to achieve :stuck_out_tongue: Perhaps there is another way to do it? Also I don’t understand why you need an overlay if it’s a sidescroller… Is it not possible to have the effect in the main scene?

Create two scripts. One called camera_copy one called camera_set
on camera copy, type the following.


import bge
cont = bge.logic.getCurrentController()
own = cont.owner

pos = own.position
bge.logic.globalDict["pos"] = pos


Then, camera set:

import bge
cont = bge.logic.getCurrentController()
own = cont.owner

if "pos" in bge.logic.globalDict:
     pos = bge.logic.globalDict["pos"]
     own.position = pos


You’ll need a True Pulse always sensor on each object, connected to the python controller.

And im guessing for orientation it should be ‘own.orientation’ although u wont require it with a side scroller but anyways u might find this useful later.

I was considering it, but i’ll include it here.

import bge
cont = bge.logic.getCurrentController()
own = cont.owner

pos = own.position
ori = own.orientation
bge.logic.globalDict["pos_ori"] = pos,ori

import bge
cont = bge.logic.getCurrentController()
own = cont.owner

if "pos_ori" in bge.logic.globalDict:
     pos,ori = bge.logic.globalDict["pos_ori"]
     own.position = pos
     own.orientation = ori

hey… thanks alot agoose77!!!
this runs flawless!!! I will soon give an update of my little game!! :smiley:

If someone wants to check it out just follow the link in my signature ^^