I'm using orbitCamera to get a topdown/isometric view. When moving beyond levelInfo visibleDistance from starting position it appears to lose controlObject connection - but I actually still have control of the playerObject and can walk it back into range.

if (isObject(%client.player)) { // The client should not already have a player. Assigning // a new one could result in an uncontrolled player object. error("Attempting to create a player for a client that already has one!"); }

// Overrides by the %spawnPoint if (isDefined("%spawnPoint.spawnClass")) { %spawnClass = %spawnPoint.spawnClass; %spawnDataBlock = %spawnPoint.spawnDatablock; } else if (isDefined("%spawnPoint.spawnDatablock")) { // This may seem redundant given the above but it allows // the SpawnSphere to override the datablock without // overriding the default player class %spawnDataBlock = %spawnPoint.spawnDatablock; }

// If we have an object do some initial setup if (isObject(%player)) { // Pick a location within the spawn sphere. %spawnLocation = GameCore::pickPointInSpawnSphere(%player, %spawnPoint); %player.setTransform(%spawnLocation);

} else { // If we weren't able to create the player object then warn the user // When the player clicks OK in one of these message boxes, we will fall through // to the "if (!isObject(%player))" check below. if (isDefined("%spawnDatablock")) { MessageBoxOK("Spawn Player Failed", "Unable to create a player with class " @ %spawnClass @ " and datablock " @ %spawnDatablock @ ".\n\nStarting as an Observer instead.", ""); } else { MessageBoxOK("Spawn Player Failed", "Unable to create a player with class " @ %spawnClass @ ".\n\nStarting as an Observer instead.", ""); } } } else {

// If we didn't actually create a player object then bail if (!isObject(%player)) { // Make sure we at least have a camera %client.spawnCamera(%spawnPoint);

return; }

/* //YORKS OUT START // Update the default camera to start with the player if (isObject(%client.camera) && !isDefined("%noControl")) { if (%player.getClassname() $= "Player") %client.camera.setTransform(%player.getEyeTransform()); else %client.camera.setTransform(%player.getTransform()); }*/ //YORKS OUT END

// Add the player object to MissionCleanup so that it // won't get saved into the level files and will get // cleaned up properly MissionCleanup.add(%player);

// Store the client object on the player object for // future reference %player.client = %client;

// If the player's client has some owned turrets, make sure we let them // know that we're a friend too. if (%client.ownedTurrets) { for (%i=0; %i<%client.ownedTurrets.getCount(); %i++) { %turret = %client.ownedTurrets.getObject(%i); %turret.addToIgnoreList(%player); } }

// Player setup... if (%player.isMethod("setShapeName")) %player.setShapeName(%client.playerName);

if (%player.isMethod("setEnergyLevel")) %player.setEnergyLevel(%player.getDataBlock().maxEnergy);

//YORKS NEW START %client.camera.setOrbitObject(%control, "1.308996 0 0" , 5.0, 20.0, 20.0,true, "0 -3.2 0", false); %client.setControlObject(%control); //- Set the control object to the player %client.setCameraObject(%client.camera); //- Set the camera object to the camera

// Allow the player/camera to receive move data from the GameConnection. Without this // the user is unable to control the player/camera. //if (!isDefined("%noControl"))//YORKS OUT // %client.setControlObject(%control);//YORKS OUT}

EDIT: visibleDistance and ghost distance thingy work fine in "normal" third person.

The issue basically is that the camera isn't the control object, so it doesn't get a move struct. It doesn't get a move struct, so it doesn't update it's position on the server. It doesn't update it's position on the server(even though the actual rendered position is updated on the client) meaning that the scope distance calculations never change because the camera hasn't 'moved'. So when the player moves too far from the camera, we leave scope.

The above code will make sure to update the camera's position if we're using ObjectOrbit mode, even in the event that the camera isn't directly controlled.