Ojects from layers

Hey,
How can i use one camera which is on layer 1 to follow an object on layer 2

network messages

you need to send position and rotation to the other scene and then convert it into vectors,

can you send a property using the message actuator?

http://wiki.blender.org/index.php/Doc:2.6/Manual/Game_Engine/Logic/Actuators/Message

the camera in the scene needs to be able to read the property from the message sensor that message actuator sends,

Dude, I think he meant layers.

I see

I was thinking overlay scene

what are you trying to use this for?

if you just want to track to a added item with the camera,

have the camera add the object using python

then set it’s own actuator to aim at that item.

In terms of game logic there are no layers. There are

  • active objects (objects residing in visible layers)
  • inactive objects (objects residing in hidden layers)

therefore your question makes not much sense to me. I suggest you rephrase it.

import bge

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

Camera = cont.actuators[‘Camera’]

added = bge.logic.getCurrentScene().addObject(‘Your_Object_Name_Here’,Object_name_to_spawn_object_at,Duration)

Camera.object = added

Hi , let me try to explain better. we have a sphere in the main layer , and when happen a collision in random place we have an actuator (end shpere) and (add cube) that is in another layer… but the camera is not tracking the cube… only the sphere…

It seems like what u want is some skybox type thing. I use this for just that. I send camera data to another scene. this cant be done through layers like Monster says. It can be done through scenes though.

from bge import logic
cont = logic.getCurrentController()
own = cont.owner
cam = own
cam2 = logic.getSceneList()[1].objects[“Camera”]

new_rotation = cam.worldOrientation
cam2.worldOrientation = new_rotation

I think you guyz not yet understand what i want or i don´t understand what you guyz meen in the answers.
I have a shpere and when a collison on a random place happen we have an actuator edit obect(end shpere) and an actuator edit obect(add cube). Now the problem is, i have 1 camera that when i press 1, follow the shphere(this is working fine) but when i made the collision and switch my shpere for a cube i don´t now how to keep following the cube.
The sphere and the camera are on layer 1 and when the actuator (add cube) is active calls from a phyton script the object cube that is on layer 2.
I hope this was more clearer
Thank’s for the help

If you want to camera to “switch” from one object to the other, just make the camera “track to” an empty, and modify this empty’s position based on game-events? You can also use this method to toggle between targets and all

https://mega.co.nz/#!XIwgnKaC!v7xEIwKKsAJfHDp931zVnYoP-rhpTRsm7axsHDcvYfM

This is an example. you need go to the red color to switch object.
Use 1 to change the camera and arrow keys to move.

Ah right, so you are not actually using the “track to” actuator… Well that’s even easier, as you can manipulate the camera object via Python:

cont.actuators['Camera'].object = YOUR_VARIABLE_HERE_for_the_new_object

Or you can still do what I suggested, having it look at an empty. That way there’s something constantly there for the camera to look at.

[EDIT]

[ATTACH]369252[/ATTACH]

Here ya go, should work fine.

Yes i think its working… we are going to try to make this on our project. Thanks:)