Game Development Community

question about setCameraObject

by addict^2 · in Torque 3D Professional · 04/07/2011 (2:37 am) · 0 replies

I'm using setCameraObject() to create in-game dialog cut scenes and but I'm having a problem when I reset the camera back to the original client's camera.

I have something like this:

function cinema1() {
  %client = ClientGroup.getObject(0);
  $lastCam = %client.getCameraObject();

  $lastView = %client.isFirstPerson();
  %client.setFirstPerson(false);
  
  %client.setCameraObject("testCam1");
  schedule(5000, 0, cinema2, %client);
}

function cinema2(%client) {
  %client.setCameraObject($lastCam);
  %client.setFirstPerson($lastView);
}

It seems to work ok except when I enter the FreeLook camera when in third person view of the Player. I have control of the camera object but the scene doesn't move with it. Is this an inappropriate way to use setCameraObject()?