Author Topic: [SOLVED] Attach/move a camera to a projectile?  (Read 600 times)

None of the default functions seem to be able to attach to a projectile object, they all still focus on the player.
« Last Edit: December 19, 2015, 12:52:28 AM by TheBlackParrot »

double-post, tried some stuff, all failed

setting the control object to the projectile: nothing changes
setting the camera's control object to the projectile: nothing changes
setOrbitMode using the projectile as the object: nothing changes
setClampMode does nothing
setMode("corpse", %projectile) asks for getControllingObject, which is protected

setDollyMode could be used in a different fashion to point from a target area at the projectile, but I'll do this as a last ditch effort as this doesn't solve my problem.


Code: [Select]
function Projectile::onAdd(%this, %obj) {
//%this.dump();
if(%obj.getDatablock().getName() $= "blankaBallProjectile") {
%client = %obj.client;
talk(%obj);

%transform = %obj.getTransform();
%client.camera.setOrbitMode(%obj, %transform, 0.5, 8, 8, 1);
%client.camera.mode = "Orbit";
%client.setControlObject(%client.camera);

}

return parent::onAdd(%this, %obj);
}
works, thanks pecon