dyme
04-21-2011, 09:44 AM
i have player movement like bounty Arms
where if you press to go left the player faces left if you press down the player faces the camera and so on.
but i still want to keep the players ability to aim up and down but this movement setup it doesnt seem possible
basically the player cant shoot anything above or below how can the player keep this movement and have the verticle aiming
function PlayerMove( float DeltaTime )
{
local vector X,Y,Z, NewAccel;
local eDoubleClickDir DoubleClickMove;
local bool bSaveJump;
local Rotator DeltaRot, ViewRotation, OldRot, NewRot;;
if( Pawn == None )
{
GotoState('Dead');
}
else
{
GetAxes(Rotation,X,Y,Z);
//update viewrotation
ViewRotation.Pitch = (-30.0f * DegToRad) * RadtoUnrRot;
// Calculate Delta to be applied on ViewRotation
DeltaRot.Yaw = PlayerInput.aTurn;
DeltaRot.Pitch = PlayerInput.aLookUp;
ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot );
SetRotation(ViewRotation);
// Update acceleration.
NewAccel = PlayerInput.aForward*X + PlayerInput.aStrafe*Y;
NewAccel.Z = 0;
// pawn face newaccel direction //
//===
OldRot = Pawn.Rotation;
if( Pawn != None )
{
if( NewAccel.X > 0.0 || NewAccel.X < 0.0 || NewAccel.Y > 0.0 || NewAccel.Y < 0.0 )
NewRot = Rotator(NewAccel);
else
NewRot = Pawn.Rotation;
}
Pawn.FaceRotation(RInterpTo(OldRot,NewRot,Deltatim e,90000,true),Deltatime);
//===
NewAccel = Pawn.AccelRate * Normal(NewAccel);
DoubleClickMove = PlayerInput.CheckForDoubleClickMove( DeltaTime/WorldInfo.TimeDilation );
bDoubleJump = false;
if( bPressedJump && Pawn.CannotJumpNow() )
{
bSaveJump = true;
bPressedJump = false;
}
{
bSaveJump = false;
}
ProcessMove(DeltaTime, NewAccel, DoubleClickMove,Rotation);
bPressedJump = bSaveJump;
}
}
code above from [Solved] 3d sidescroller camera help
this gives the proper movement but aiming doesnt work
any help or is it possible
where if you press to go left the player faces left if you press down the player faces the camera and so on.
but i still want to keep the players ability to aim up and down but this movement setup it doesnt seem possible
basically the player cant shoot anything above or below how can the player keep this movement and have the verticle aiming
function PlayerMove( float DeltaTime )
{
local vector X,Y,Z, NewAccel;
local eDoubleClickDir DoubleClickMove;
local bool bSaveJump;
local Rotator DeltaRot, ViewRotation, OldRot, NewRot;;
if( Pawn == None )
{
GotoState('Dead');
}
else
{
GetAxes(Rotation,X,Y,Z);
//update viewrotation
ViewRotation.Pitch = (-30.0f * DegToRad) * RadtoUnrRot;
// Calculate Delta to be applied on ViewRotation
DeltaRot.Yaw = PlayerInput.aTurn;
DeltaRot.Pitch = PlayerInput.aLookUp;
ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot );
SetRotation(ViewRotation);
// Update acceleration.
NewAccel = PlayerInput.aForward*X + PlayerInput.aStrafe*Y;
NewAccel.Z = 0;
// pawn face newaccel direction //
//===
OldRot = Pawn.Rotation;
if( Pawn != None )
{
if( NewAccel.X > 0.0 || NewAccel.X < 0.0 || NewAccel.Y > 0.0 || NewAccel.Y < 0.0 )
NewRot = Rotator(NewAccel);
else
NewRot = Pawn.Rotation;
}
Pawn.FaceRotation(RInterpTo(OldRot,NewRot,Deltatim e,90000,true),Deltatime);
//===
NewAccel = Pawn.AccelRate * Normal(NewAccel);
DoubleClickMove = PlayerInput.CheckForDoubleClickMove( DeltaTime/WorldInfo.TimeDilation );
bDoubleJump = false;
if( bPressedJump && Pawn.CannotJumpNow() )
{
bSaveJump = true;
bPressedJump = false;
}
{
bSaveJump = false;
}
ProcessMove(DeltaTime, NewAccel, DoubleClickMove,Rotation);
bPressedJump = bSaveJump;
}
}
code above from [Solved] 3d sidescroller camera help
this gives the proper movement but aiming doesnt work
any help or is it possible