CopyFrom works in Unity, not on device

I’m trying to reset the camera back to a default position.

So, I duplicate the main camera, call it something else, and remove any audio listeners and so on. So Unity doesn’t get confused with which camera to use, I disable the “Reset” camera.

I then set references to the main camera and reset camera in my code:

public Camera gResetCam, gMainCam;

and when I want to reset the position and rotation of the main camera I use:

gMainCam.CopyFrom( gResetCam );

Now, within Unity this behaves as expected. On the phone however, it doesn’t work - I think it’s setting the position to (0, 0, 0).

Any clues?

Many thanks,

Mark

you only have a single camera on the iphone, not multiple ones.
Its pretty much possible that any camera beside the main camera therefor is beeing ignored, especially as the main camera is the only camera used at all on Unity iPhone, for culling for example.

Ah! Forgot about that restriction, thanks =)

I now keep a copy of the initial transform position and localEulerAngles and copy those over instead.

Thanks again,

M

I use multiple cameras on the iphone…