PDA

View Full Version : camera (isometric camera) start position problem



bloodyDziq
07-18-2011, 06:10 AM
Hi,
I'm trying to setup a environment for my game whit isometric camera that is not attached to the player.

Can some show me how to set up a starting position for the camera?
On level start I wont the came to show the player.

many Thanks :)

bloodyDziq
07-20-2011, 05:37 PM
OK, I manage to come up whit a solution but I'm not proud of it :mad:



class UDNPlayerCamera extends Camera;

var bool CameraToPawn
var Vector Loc;

function UpdateViewTarget(out TViewTarget OutVT, float DeltaTime)
{
local rotator Rot;

Rot.Pitch = (-55.0f *DegToRad) * RadToUnrRot;
Rot.Roll = (0 *DegToRad) * RadToUnrRot;
Rot.Yaw = (30.0f *DegToRad) * RadToUnrRot;

if (!CameraToPawn && PCOwner.Pawn.Location.X != vect(0.0,0.0,0.0)){
Loc.X = PCOwner.Pawn.Location.X - 64;
Loc.Y = PCOwner.Pawn.Location.Y - 64;
Loc.Z = PCOwner.Pawn.Location.Z + 156;

CameraToPawn = TRUE;
}

OutVT.POV.Rotation = Rot;
OutVT.POV.Location = Loc - Vector(Rot) * FreeCamDistance;;
}

defaultproperties
{
CameraToPawn=FALSE;
}

works, but I'm sure there is a better way. If some one can help I will be very grateful :)