Just curious have you set the crosshair to move to where the pawn is aiming?
Code:
class SideScrollingShootAllDirectionPawn extends UTPawn;
var float CamOffsetDistance; //Position on Y-axis to lock camera to
//override to make player mesh visible by default
simulated event BecomeViewTarget( PlayerController PC )
{
local UTPlayerController UTPC;
Super.BecomeViewTarget(PC);
if (LocalPlayer(PC.Player) != None)
{
UTPC = UTPlayerController(PC);
if (UTPC != None)
{
//set player controller to behind view and make mesh visible
UTPC.SetBehindView(true);
SetMeshVisibility(UTPC.bBehindView);
UTPC.bNoCrosshair = true;
}
}
}
simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
{
out_CamLoc = Location;
out_CamLoc.Y = CamOffsetDistance;
out_CamRot.Pitch = 0;
out_CamRot.Yaw = 16384;
out_CamRot.Roll = 0;
return true;
}
simulated singular event Rotator GetBaseAimRotation()
{
//local vector POVLoc;
local rotator POVRot;
// If we have a controller, by default we aim at the player's 'eyes' direction
// that is by default Controller.Rotation for AI, and camera (crosshair) rotation for human players.
// If we have no controller, we simply use our rotation
POVRot = Rotation;
// If our Pitch is 0, then use RemoveViewPitch
if( POVRot.Pitch == 0 )
{
POVRot.Pitch = RemoteViewPitch << 8;
}
return POVRot;
}
Code:
Class SidescrollingShootallDirectionsPC extends UTPlayerController;
state PlayerWalking
{
ignores SeePlayer, HearNoise, Bump;
function ProcessMove(float DeltaTime, vector NewAccel, eDoubleClickDir DoubleClickMove, rotator DeltaRot)
{
local Rotator tempRot;
if( Pawn == None )
{
return;
}
if (Role == ROLE_Authority)
{
// Update ViewPitch for remote clients
Pawn.SetRemoteViewPitch( Rotation.Pitch );
}
Pawn.Acceleration.X = -1 * PlayerInput.aStrafe * DeltaTime * 100 * PlayerInput.MoveForwardSpeed;
Pawn.Acceleration.Y = 0;
Pawn.Acceleration.Z = 0;
tempRot.Pitch = Pawn.Rotation.Pitch;
tempRot.Roll = 0;
if(Normal(Pawn.Acceleration) Dot Vect(1,0,0) > 0)
{
tempRot.Yaw = 0;
Pawn.SetRotation(tempRot);
}
else if(Normal(Pawn.Acceleration) Dot Vect(1,0,0) < 0)
{
tempRot.Yaw = 32768;
Pawn.SetRotation(tempRot);
}
CheckJumpOrDuck();
}
}
I have not used your codes at all because it required your custom classes and It was much easier to debug using these codes instead. This should be what your looking for though I had no idea how to do this myself as of 15-20minutes ago I worked out how to do it through trial and error and tracing back functions to what they do originally before side scrolling.
Bookmarks