Thanks dude for the tips, trully thanks :D, however I am not using calccamera because whenever you use this function you can`t have camera animations, like stated on UDN:
“Implementing Pawn.CalcCamera() is useful for simple and straightforward camera modes. The tradeoff is that some functionality may not be fully functional via this method, including post process effects or camera animations.”
I am using a third person camera with execution animations and a custom camera animation (GOW Chainsaw): https://www.youtube.com/watch?v=V3BqY_-v1QE
So is possible to do this without using CalcCamera?
These are my main gametype classes. I based these classes on mouglis custom camera tutorial: http://www.moug-portfolio.info/udk-camera-basics/
class UDKUltimate extends UTTeamGame;
defaultproperties
{
bDelayedStart=false //We want to jump straight into the game
bScoreTeamKills=true
bMustJoinBeforeStart=false
bTeamGame=True
TeamAIType(0)=class’UTGame.UTTeamAI’
TeamAIType(1)=class’UTGame.UTTeamAI’
EndMessageWait=1
TeammateBoost=+0.3
FriendlyFireScale=+0.0
bMustHaveMultiplePlayers=true
FlagKillMessageName=TAUNT
DefaultPawnClass=class’UDKUltimate.UDKUltimatePawn’
PlayerControllerClass=class’UDKUltimate.UDKUltimatePlayerController’
Acronym=“AI”
MapPrefixes[0]=“AI”
OnlineGameSettingsClass=class’UTGame.UTGameSettingsDM’
MidgameScorePanelTag=TDMPanel
}
//////////////////////////////////////////////////////////////////////////////////////////////////
class UDKUltimatePawn extends UTPawn;
//this variable will store the animation node chainsaw attack
//this animation is setup on the Animtree
var AnimNodePlayCustomAnim ChainsawAnim;
//this function will find the animation node and store this to another variable
//this variable will be called by the weapon code
simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp)
{
super.PostInitAnimTree(SkelComp);
if (SkelComp == Mesh)
{
ChainsawAnim = AnimNodePlayCustomAnim(SkelComp.FindAnimNode(‘ChainsawAnim’));
}
}
//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
//since we are not using the Pawn.CalcCamera() function so camera animations (chainsaw execution, i.e) will work normally
UTPC.SetBehindView(true);
SetMeshVisibility(UTPC.bBehindView);
}
}
}
defaultproperties
{
Health=300
HealthMax=300
bPhysRigidBodyOutOfWorldCheck=TRUE
bRunPhysicsWithNoController=true
LeftFootControlName=LeftFootControl
RightFootControlName=RightFootControl
bEnableFootPlacement=true
MaxFootPlacementDistSquared=56250000.0 // 7500 squared
}
//////////////////////////////////////////////////////////////////////////////////////////////////
class UDKUltimatePlayerController extends UTPlayerController;
defaultproperties
{
CameraClass=class’UDKUltimate.UDKUltimateCamera’
}
//////////////////////////////////////////////////////////////////////////////////////////////////
class UDKUltimateCamera extends GamePlayerCamera;
protected function GameCameraBase FindBestCameraType(Actor CameraTarget)
{
//Add here the code that will figure out which cam to use.
return ThirdPersonCam; // We only have this camera
}
DefaultProperties
{
ThirdPersonCameraClass=class’UDKUltimate.UDKUltimateThirdPersonCamera’
}
//////////////////////////////////////////////////////////////////////////////////////////////////
class UDKUltimateThirdPersonCamera extends GameCameraBase;
var float ThirdPersonCamOffsetX;
var float ThirdPersonCamOffsetY;
var float ThirdPersonCamOffsetZ;
var Rotator CurrentCamOrientation;
var Rotator DesiredCamOrientation;
function UpdateCamera(Pawn P, GamePlayerCamera CameraActor, float DeltaTime, out TViewTarget OutVT)
{
local float Radius, Height;
local vector X,Y,Z;
P.GetAxes(DesiredCamOrientation,X,Y,Z); // We will be working with coordinates in pawn space, but rotated according to the Desired Rotation.
P.GetBoundingCylinder(Radius, Height); //Get the pawn’s height as a base for the Z offset.
OutVT.POV.Location = P.Location + ThirdPersonCamOffsetX * X + ThirdPersonCamOffsetY * Y + (Height+ThirdPersonCamOffsetZ) * Z;
if (DesiredCamOrientation != CurrentCamOrientation)
{
CurrentCamOrientation = RInterpTo(CurrentCamOrientation,DesiredCamOrientation,DeltaTime,10);
}
OutVT.POV.Rotation = CurrentCamOrientation;
}
function ProcessViewRotation( float DeltaTime, Actor ViewTarget, out Rotator out_ViewRotation, out Rotator out_DeltaRot )
{
DesiredCamOrientation = out_ViewRotation + out_DeltaRot;
}
DefaultProperties
{
ThirdPersonCamOffsetX=-80.0
ThirdPersonCamOffsetY=8.0
ThirdPersonCamOffsetZ=-32.0
}
//////////////////////////////////////////////////////////////////////////////////////////////////