Hey there,
I'm trying to get something going here. What I'm hoping to achieve is a 3rd Person view, but that doesn't lock the cursor in the middle of the screen.
My code so far:
So this gets the 3rd Person how I want it, but A) my model is facing upwards at all times and B) The cursor is stuck in the middle of the screen, thus I only shoot forwards. What I want is to have a loose cursor, and when the cursor approaches say the edges of the screen, then the model switches to that direction. (Sort of like when you're in a vehicle in the game)
Sorry it's kind of hard to explain. But any help would be great.
I'm trying to get something going here. What I'm hoping to achieve is a 3rd Person view, but that doesn't lock the cursor in the middle of the screen.
My code so far:
Code:
class Test3P extends xPlayer;
event PlayerCalcView(out actor ViewActor, out vector CameraLocation, out rotator CameraRotation )
{
local vector RCCalc;
if(IsInState('PlayerWalking') || IsInState('PlayerSwimming') || IsInState('PlayerFlying') || IsInState('PlayerDriving')){
if(VSize(Pawn.Velocity) > 0 || bFire != 0 || bAltFire != 0){
bFreeCamera=false;
bBehindView=true;
ViewActor = ViewTarget;
CameraLocation = ViewActor.Location;
CameraLocation.z+=100;
CameraRotation.Pitch= 58225; //Lock the pitch.
RCCalc= 500 * vector(CameraRotation);
CameraLocation = CameraLocation- RCCalc;
Log("Pitch: "@CameraRotation.Pitch);
}
else{
bFreeCamera=true;
bBehindView=true;
ViewActor = ViewTarget;
CameraLocation = ViewActor.Location;
CameraLocation.z+=100;
CameraRotation.Pitch= 58225; //Lock the pitch.
RCCalc= 500 * vector(CameraRotation);
CameraLocation = CameraLocation- RCCalc;
Log("Pitch: "@CameraRotation.Pitch);
}
}
}
So this gets the 3rd Person how I want it, but A) my model is facing upwards at all times and B) The cursor is stuck in the middle of the screen, thus I only shoot forwards. What I want is to have a loose cursor, and when the cursor approaches say the edges of the screen, then the model switches to that direction. (Sort of like when you're in a vehicle in the game)
Sorry it's kind of hard to explain. But any help would be great.