3rd Person Cursor

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Unstable-Joe

New Member
Feb 26, 2005
2
0
0
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:

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.
 

MonsOlympus

Active Member
May 27, 2004
2,225
0
36
42
Yeah, this is a cool idea!

I want to do something like this myself, Ive looked over the vehicle code specifically for the hover bike. It seems possible but Im a little unsure on how to implement this.
I want a cursor that will be free and turn the player but I would like to limit the pitches so that you cant look all the way up or down.
I would like the camera to point at the cursor instead of the player.

I would be more than willing to help you out if you can spare some time to talk somethings through.
 
Last edited: