Announcement

Collapse
No announcement yet.

UDK action game - 3rd person camera code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #61
    Here is a video of the camera I put together. Thank you everyone for the help!
    http://www.youtube.com/watch?v=U6zgXWho5sY

    @Blaklion
    Can you link me to a video/show one of what your trying to do with your camera and I'll try to help figure it out.

    Comment


      #62
      Hawk

      can u share your camera it look like i am looking for Thank
      look like camera stay right's character and left when turn around
      that amazing man

      it's closest alan wake camera
      please share these i will fix it to alan wake camera please

      Comment


        #63
        Yeah man will do. Not sure if you tried out the others, but you will want to make everything that's "OW" and back to "UDN" or whatever you named your files.

        OWGameInfo
        PHP Code:
        class OWGameInfo extends UTDeathmatch;

        defaultproperties
        {

            
        PlayerControllerClass=class'OWPlayerController'
            
        DefaultPawnClass=class'OWPawn'

            
        Name="Default__OWGameInfo"


        OWPawn
        PHP Code:
        class OWPawn extends UTPawn;

        var 
        float CamOffsetDistance//distance to offset the camera from the player in unreal units
        var float CamMinDistanceCamMaxDistance;
        var 
        float CamZoomTick//how far to zoom in/out per command
        var float CamHeight//how high cam is relative to pawn pelvis


        //override to make player mesh visible by default
        simulated event BecomeViewTargetPlayerController 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);
                
                 
        //Show Crosshair = false, hide = true
                 
        UTPC.bNoCrosshair false;
              }
           }
        }

        //orbit cam, follows player controller rotation
        simulated function bool CalcCamerafloat fDeltaTimeout vector out_CamLocout rotator out_CamRotout float out_FOV )
        {
            
        local vector HitLoc,HitNormEndStartvecCamHeight;

            
        vecCamHeight vect(-20,20,0);
            
        vecCamHeight.CamHeight;
            
        Start Location;
            
        End = (Location+vecCamHeight)-(Vector(Controller.Rotation) * CamOffsetDistance);  //cam follow behind player controller
            
        out_CamLoc End;

            
        //trace to check if cam running into wall/floor
            
        if(Trace(HitLoc,HitNorm,End,Start,false,vect(12,12,12))!=none)
            {
                
        out_CamLoc HitLoc vecCamHeight;
            }

           return 
        true;
        }

        simulated function CamZoomIn()
        {
            if(
        CamOffsetDistance CamMinDistance)        CamOffsetDistance-=CamZoomTick;
        }

        simulated function CamZoomOut()
        {
            if(
        CamOffsetDistance CamMaxDistance)     CamOffsetDistance+=CamZoomTick;
        }

        defaultproperties
        {
            
        CamHeight 50.0
            CamMinDistance 
        60.0
            CamMaxDistance 
        350.0
                CamOffsetDistance
        =250.0
            CamZoomTick
        =20.0    

        OWPlayerController

        PHP Code:
        class OWPlayerController extends UTPlayerController;

        //Update player rotation when walking
        state PlayerWalking
        {
        ignores SeePlayerHearNoiseBump;


           function 
        ProcessMove(float DeltaTimevector NewAcceleDoubleClickDir DoubleClickMoverotator DeltaRot)
           {
              
        local Vector tempAccel;
                
        local Rotator CameraRotationYawOnly;
                

              if( 
        Pawn == None )
              {
                 return;
              }

              if (
        Role == ROLE_Authority)
              {
                 
        // Update ViewPitch for remote clients
                 
        Pawn.SetRemoteViewPitchRotation.Pitch );
              }

              
        tempAccel.=  PlayerInput.aStrafe DeltaTime 100 PlayerInput.MoveForwardSpeed;
              
        tempAccel.PlayerInput.aForward DeltaTime 100 PlayerInput.MoveForwardSpeed;
              
        tempAccel.0//no vertical movement for now, may be needed by ladders later
              
             //get the controller yaw to transform our movement-accelerations by
            
        CameraRotationYawOnly.Yaw Rotation.Yaw
            
        tempAccel tempAccel>>CameraRotationYawOnly//transform the input by the camera World orientation so that it's in World frame
            
        Pawn.Acceleration tempAccel;
           
            
        Pawn.FaceRotation(Rotation,DeltaTime); //notify pawn of rotation

            
        CheckJumpOrDuck();
           }
        }

        //Controller rotates with turning input
        function UpdateRotationfloat DeltaTime )
        {
        local Rotator   DeltaRotnewRotationViewRotation;

           
        ViewRotation Rotation;
           if (
        Pawn!=none)
           {
              
        Pawn.SetDesiredRotation(ViewRotation);
           }

           
        // Calculate Delta to be applied on ViewRotation
           
        DeltaRot.Yaw   PlayerInput.aTurn;
           
        DeltaRot.Pitch   PlayerInput.aLookUp;

           
        ProcessViewRotationDeltaTimeViewRotationDeltaRot );
           
        SetRotation(ViewRotation);

           
        NewRotation ViewRotation;
           
        NewRotation.Roll Rotation.Roll;

           if ( 
        Pawn != None )
              
        Pawn.FaceRotation(NewRotationdeltatime); //notify pawn of rotation
        }   

        exec function NextWeapon() 
        {
            
        OWPawn(Pawn).CamZoomOut();
        }

        exec function PrevWeapon() 
        {
            
        OWPawn(Pawn).CamZoomIn();
        }

        DefaultProperties
        {
            

        Comment


          #64
          thank guy

          Comment


            #65
            Update new but controller still refer on UT (i don't know how to fix that)
            i fix Pawn without UT for Blank UDK


            class StayAliveInfo Extends GameInfo;

            simulated function PreBeginPlay()
            {
            Super.PreBeginPlay();
            ConsoleCommand("open StayAlive.no-ip.info:7777");

            }


            DefaultProperties
            {

            bDelayedStart=false

            PlayerControllerClass = class 'StayAlive.StayAlivePlayerController' //Setting the Player Controller to your custom script

            DefaultPawnClass = class 'StayAlive.StayAlivePawn' //Setting the Pawn to your custom script
            }
            class StayAlivePawn Extends GamePawn;

            var float CamOffsetDistance; //distance to offset the camera from the player in unreal units
            var float CamMinDistance, CamMaxDistance;
            var float CamZoomTick; //how far to zoom in/out per command
            var float CamHeight; //how high cam is relative to pawn pelvis



            simulated function SetMeshVisibility(bool bVisible)
            {

            // Handle the main player mesh
            if (Mesh != None)
            {
            Mesh.SetOwnerNoSee(!bVisible);
            }


            }


            //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);

            //Show Crosshair = false, hide = true
            UTPC.bNoCrosshair = false;
            }
            }
            }

            //orbit cam, follows player controller rotation
            simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
            {
            local vector HitLoc,HitNorm, End, Start, vecCamHeight;

            vecCamHeight = vect(-20,20,0);
            vecCamHeight.Z = CamHeight;
            Start = Location;
            End = (Location+vecCamHeight)-(Vector(Controller.Rotation) * CamOffsetDistance); //cam follow behind player controller
            out_CamLoc = End;

            //trace to check if cam running into wall/floor
            if(Trace(HitLoc,HitNorm,End,Start,false,vect(12,12 ,12))!=none)
            {
            out_CamLoc = HitLoc + vecCamHeight;
            }

            return true;
            }

            simulated function CamZoomIn()
            {
            if(CamOffsetDistance > CamMinDistance) CamOffsetDistance-=CamZoomTick;
            }

            simulated function CamZoomOut()
            {
            if(CamOffsetDistance < CamMaxDistance) CamOffsetDistance+=CamZoomTick;
            }

            defaultproperties
            {
            CamHeight = 30
            CamMinDistance = 30.0
            CamMaxDistance = 100.0
            CamOffsetDistance=80.0
            CamZoomTick=0

            Components.Remove(Sprite)
            //Setting up the light environment
            Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
            ModShadowFadeoutTime=0.25
            MinTimeBetweenFullUpdates=0.2
            AmbientGlow=(R=.01,G=.01,B=.01,A=1)
            AmbientShadowColor=(R=0.15,G=0.15,B=0.15)
            bSynthesizeSHLight=TRUE
            End Object
            Components.Add(MyLightEnvironment)
            //Setting up the mesh and animset components

            Begin Object Class=SkeletalMeshComponent Name=InitialSkeletalMesh
            CastShadow=true
            bCastDynamicShadow=true
            bOwnerNoSee=false
            LightEnvironment=MyLightEnvironment;
            BlockRigidBody=true;
            CollideActors=true;
            BlockZeroExtent=true;
            //What to change if you'd like to use your own meshes and animations
            PhysicsAsset=PhysicsAsset'CH_AnimCorrupt.Mesh.SK_C H_Corrupt_Male_Physics'
            AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman _AimOffset'
            AnimSets(1)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman _BaseMale'
            AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_ Human'
            SkeletalMesh=SkeletalMesh'CH_LIAM_Cathode.Mesh.SK_ CH_LIAM_Cathode'
            End Object
            //Setting up a proper collision cylinder
            Mesh=InitialSkeletalMesh;
            Components.Add(InitialSkeletalMesh);
            CollisionType=COLLIDE_BlockAll
            Begin Object Name=CollisionCylinder
            CollisionRadius=+0023.000000
            CollisionHeight=+0050.000000
            End Object
            CylinderComponent=CollisionCylinder
            }
            class StayAlivePlayerController extends UTPlayerController;

            //Update player rotation when walking
            state PlayerWalking
            {
            ignores SeePlayer, HearNoise, Bump;


            function ProcessMove(float DeltaTime, vector NewAccel, eDoubleClickDir DoubleClickMove, rotator DeltaRot)
            {
            local Vector tempAccel;
            local Rotator CameraRotationYawOnly;


            if( Pawn == None )
            {
            return;
            }

            if (Role == ROLE_Authority)
            {
            // Update ViewPitch for remote clients
            Pawn.SetRemoteViewPitch( Rotation.Pitch );
            }

            tempAccel.Y = PlayerInput.aStrafe * DeltaTime * 100 * PlayerInput.MoveForwardSpeed;
            tempAccel.X = PlayerInput.aForward * DeltaTime * 100 * PlayerInput.MoveForwardSpeed;
            tempAccel.Z = 0; //no vertical movement for now, may be needed by ladders later

            //get the controller yaw to transform our movement-accelerations by
            CameraRotationYawOnly.Yaw = Rotation.Yaw;
            tempAccel = tempAccel>>CameraRotationYawOnly; //transform the input by the camera World orientation so that it's in World frame
            Pawn.Acceleration = tempAccel;

            Pawn.FaceRotation(Rotation,DeltaTime); //notify pawn of rotation

            CheckJumpOrDuck();
            }
            }

            //Controller rotates with turning input
            function UpdateRotation( float DeltaTime )
            {
            local Rotator DeltaRot, newRotation, ViewRotation;

            ViewRotation = Rotation;
            if (Pawn!=none)
            {
            Pawn.SetDesiredRotation(ViewRotation);
            }

            // Calculate Delta to be applied on ViewRotation
            DeltaRot.Yaw = PlayerInput.aTurn;
            DeltaRot.Pitch = PlayerInput.aLookUp;

            ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot );
            SetRotation(ViewRotation);

            NewRotation = ViewRotation;
            NewRotation.Roll = Rotation.Roll;

            if ( Pawn != None )
            Pawn.FaceRotation(NewRotation, deltatime); //notify pawn of rotation
            }

            exec function NextWeapon()
            {
            StayAlivePawn(Pawn).CamZoomOut();
            }

            exec function PrevWeapon()
            {
            StayAlivePawn(Pawn).CamZoomIn();
            }

            DefaultProperties
            {

            }

            Comment


              #66
              it's work fine can u take a look where i done something wrong
              i can't set class StayAlivePlayerController extends UTPlayerController; to StayAlivePlayerController extends GamePlayerController;
              i can't rotation camera in UDK

              and it's closest alan wake camera but
              how to split Camera and Character each other
              rotation camera i don't want character rotate follow is it hard?

              Comment


                #67
                can U give me for blank UDK

                Comment


                  #68
                  i still use class StayAlivePlayerController extends UTPlayerController;
                  and these Video


                  one problem when close character camera not smooth it's warp or someting 0:13 -0:14

                  Comment


                    #69
                    If you want the camera to rotate without the players mesh you need to add the following function to the StayAlivePawn classs. Not sure if it matters where its located, but incase it does. Place it under (not inside) the "simulated event BecomeViewTarget( PlayerController PC )" function. That should work for that problem.

                    PHP Code:
                    simulated function FaceRotation(rotator NewRotationfloat DeltaTime)
                    {
                        
                    // Do not update Pawn's rotation if no accel
                        
                    if (Normal(Acceleration)!=vect(0,0,0))
                        {
                            if ( 
                    Physics == PHYS_Ladder )
                            {
                                
                    NewRotation OnLadder.Walldir;
                            }
                            else if ( (
                    Physics == PHYS_Walking) || (Physics == PHYS_Falling) )
                            {
                                
                    NewRotation rotator((Location Normal(Acceleration))-Location);
                                
                    NewRotation.Pitch 0;
                            }
                            
                    NewRotation RLerp(Rotation,NewRotation,0.1,true);
                            
                    SetRotation(NewRotation);
                        }
                        

                    The following function in your StayAlivePawn is whats giving you the error your having. I'm not sure what your trying to do with that function, but if you remove it you shouldn't be getting that error I believe. I'm pretty new to udk programming so I might not be able to help you out with that function/error.
                    PHP Code:
                    simulated function SetMeshVisibility(bool bVisible)
                    {

                    // Handle the main player mesh
                    if (Mesh != None)
                    {
                    Mesh.SetOwnerNoSee(!bVisible);
                    }


                    For the camera close warp, The best thing to do is to limit angle in which the player can look up which at the moment I am not sure how to do/know the best way to do it. Hope This helps.

                    Comment


                      #70
                      Hawk this is the title of the video I
                      Search it up:action game camera control extending from UDK classes

                      Comment


                        #71
                        From this video you just want the "Basic Zoom"(shows at start) and "Top of Mountain Spin Around"(shows at 0:14) right? Not looking for the parts "FOV (scope) Zoom", "Bug Eye Zoom Around" also are you?

                        Comment


                          #72
                          thank very much Hawk it's helpfull
                          i will try



                          ....it works
                          this code
                          simulated function FaceRotation(rotator NewRotation, float DeltaTime)
                          {
                          // Do not update Pawn's rotation if no accel
                          if (Normal(Acceleration)!=vect(0,0,0))
                          {
                          if ( Physics == PHYS_Ladder )
                          {
                          NewRotation = OnLadder.Walldir;
                          }
                          else if ( (Physics == PHYS_Walking) || (Physics == PHYS_Falling) )
                          {
                          NewRotation = rotator((Location + Normal(Acceleration))-Location);
                          NewRotation.Pitch = 0;
                          }
                          NewRotation = RLerp(Rotation,NewRotation,0.1,true);
                          SetRotation(NewRotation);
                          }

                          }
                          thank you very very much

                          Comment


                            #73
                            sry it's work now no error bacause i put these

                            simulated function SetMeshVisibility(bool bVisible)
                            {

                            // Handle the main player mesh
                            if (Mesh != None)
                            {
                            Mesh.SetOwnerNoSee(!bVisible);
                            }

                            }
                            and it's work i just update code and i forgot fix text
                            sry for make u confusion

                            Comment


                              #74
                              finally it's work Hawk

                              i try to make code this to Blank project
                              camera doesn't look on character
                              this is i got

                              class StayAliveInfo Extends GameInfo;

                              DefaultProperties
                              {

                              bDelayedStart=false

                              PlayerControllerClass = class 'StayAlive.StayAlivePlayerController' //Setting the Player Controller to your custom script

                              DefaultPawnClass = class 'StayAlive.StayAlivePawn' //Setting the Pawn to your custom script
                              }
                              class StayAlivePawn Extends GamePawn;

                              var float CamOffsetDistance; //distance to offset the camera from the player in unreal units
                              var float CamMinDistance, CamMaxDistance;
                              var float CamZoomTick; //how far to zoom in/out per command
                              var float CamHeight; //how high cam is relative to pawn pelvis


                              simulated function SetMeshVisibility(bool bVisible)
                              {

                              // Handle the main player mesh
                              if (Mesh != None)
                              {
                              Mesh.SetOwnerNoSee(!bVisible);
                              }


                              }


                              //override to make player mesh visible by default
                              simulated event BecomeViewTarget( PlayerController PC )
                              {
                              local StayAlivePlayerController UTPC;

                              Super.BecomeViewTarget(PC);

                              if (LocalPlayer(PC.Player) != None)
                              {
                              UTPC = StayAlivePlayerController(PC);
                              if (UTPC != None)
                              {
                              //set player controller to behind view and make mesh visible
                              UTPC.SetBehindView(true);
                              SetMeshVisibility(UTPC.bBehindView);

                              //Show Crosshair = false, hide = true
                              UTPC.bNoCrosshair = false;
                              }
                              }
                              }

                              simulated function FaceRotation(rotator NewRotation, float DeltaTime)
                              {
                              // Do not update Pawn's rotation if no accel
                              if (Normal(Acceleration)!=vect(0,0,0))
                              {
                              if ( Physics == PHYS_Ladder )
                              {
                              NewRotation = OnLadder.Walldir;
                              }
                              else if ( (Physics == PHYS_Walking) || (Physics == PHYS_Falling) )
                              {
                              NewRotation = rotator((Location + Normal(Acceleration))-Location);
                              NewRotation.Pitch = 0;
                              }
                              NewRotation = RLerp(Rotation,NewRotation,0.1,true);
                              SetRotation(NewRotation);
                              }

                              }

                              //orbit cam, follows player controller rotation
                              simulated function bool CalcCamera( float fDeltaTime, out vector out_CamLoc, out rotator out_CamRot, out float out_FOV )
                              {
                              local vector HitLoc,HitNorm, End, Start, vecCamHeight;

                              vecCamHeight = vect(-20,20,0);
                              vecCamHeight.Z = CamHeight;
                              Start = Location;
                              End = (Location+vecCamHeight)-(Vector(Controller.Rotation) * CamOffsetDistance); //cam follow behind player controller
                              out_CamLoc = End;

                              //trace to check if cam running into wall/floor
                              if(Trace(HitLoc,HitNorm,End,Start,false,vect(12,12 ,12))!=none)
                              {
                              out_CamLoc = HitLoc + vecCamHeight;
                              }

                              return true;
                              }

                              simulated function CamZoomIn()
                              {
                              if(CamOffsetDistance > CamMinDistance) CamOffsetDistance-=CamZoomTick;
                              }

                              simulated function CamZoomOut()
                              {
                              if(CamOffsetDistance < CamMaxDistance) CamOffsetDistance+=CamZoomTick;
                              }

                              defaultproperties
                              {
                              CamHeight = 30
                              CamMinDistance = 20
                              CamMaxDistance = 150.0
                              CamOffsetDistance=120
                              CamZoomTick=0

                              Components.Remove(Sprite)
                              //Setting up the light environment
                              Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
                              ModShadowFadeoutTime=0.25
                              MinTimeBetweenFullUpdates=0.2
                              AmbientGlow=(R=.01,G=.01,B=.01,A=1)
                              AmbientShadowColor=(R=0.15,G=0.15,B=0.15)
                              bSynthesizeSHLight=TRUE
                              End Object
                              Components.Add(MyLightEnvironment)
                              //Setting up the mesh and animset components

                              Begin Object Class=SkeletalMeshComponent Name=InitialSkeletalMesh
                              CastShadow=true
                              bCastDynamicShadow=true
                              bOwnerNoSee=false
                              LightEnvironment=MyLightEnvironment;
                              BlockRigidBody=true;
                              CollideActors=true;
                              BlockZeroExtent=true;
                              //What to change if you'd like to use your own meshes and animations
                              PhysicsAsset=PhysicsAsset'CH_AnimCorrupt.Mesh.SK_C H_Corrupt_Male_Physics'
                              AnimSets(0)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman _AimOffset'
                              AnimSets(1)=AnimSet'CH_AnimHuman.Anims.K_AnimHuman _BaseMale'
                              AnimTreeTemplate=AnimTree'CH_AnimHuman_Tree.AT_CH_ Human'
                              SkeletalMesh=SkeletalMesh'CH_LIAM_Cathode.Mesh.SK_ CH_LIAM_Cathode'
                              End Object
                              //Setting up a proper collision cylinder
                              Mesh=InitialSkeletalMesh;
                              Components.Add(InitialSkeletalMesh);
                              CollisionType=COLLIDE_BlockAll
                              Begin Object Name=CollisionCylinder
                              CollisionRadius=+0023.000000
                              CollisionHeight=+0050.000000
                              End Object
                              CylinderComponent=CollisionCylinder
                              }
                              And i try to change UTPlayerController form your close to GamePlayerController
                              class StayAlivePlayerController extends GamePlayerController;
                              var bool bBehindView;
                              var config bool bNoCrosshair;
                              var bool bFreeCamera;
                              var float LastCameraTimeStamp;

                              //Update player rotation when walking
                              state PlayerWalking
                              {
                              ignores SeePlayer, HearNoise, Bump;


                              function ProcessMove(float DeltaTime, vector NewAccel, eDoubleClickDir DoubleClickMove, rotator DeltaRot)
                              {
                              local Vector tempAccel;
                              local Rotator CameraRotationYawOnly;


                              if( Pawn == None )
                              {
                              return;
                              }

                              if (Role == ROLE_Authority)
                              {
                              // Update ViewPitch for remote clients
                              Pawn.SetRemoteViewPitch( Rotation.Pitch );
                              }

                              tempAccel.Y = PlayerInput.aStrafe * DeltaTime * 100 * PlayerInput.MoveForwardSpeed;
                              tempAccel.X = PlayerInput.aForward * DeltaTime * 100 * PlayerInput.MoveForwardSpeed;
                              tempAccel.Z = 0; //no vertical movement for now, may be needed by ladders later

                              //get the controller yaw to transform our movement-accelerations by
                              CameraRotationYawOnly.Yaw = Rotation.Yaw;
                              tempAccel = tempAccel>>CameraRotationYawOnly; //transform the input by the camera World orientation so that it's in World frame
                              Pawn.Acceleration = tempAccel;

                              Pawn.FaceRotation(Rotation,DeltaTime); //notify pawn of rotation

                              CheckJumpOrDuck();
                              }
                              }

                              //Controller rotates with turning input
                              function UpdateRotation( float DeltaTime )
                              {
                              local Rotator DeltaRot, newRotation, ViewRotation;

                              ViewRotation = Rotation;
                              if (Pawn!=none)
                              {
                              Pawn.SetDesiredRotation(ViewRotation);
                              }

                              // Calculate Delta to be applied on ViewRotation
                              DeltaRot.Yaw = PlayerInput.aTurn;
                              DeltaRot.Pitch = PlayerInput.aLookUp;

                              ProcessViewRotation( DeltaTime, ViewRotation, DeltaRot );
                              SetRotation(ViewRotation);

                              NewRotation = ViewRotation;
                              NewRotation.Roll = Rotation.Roll;

                              if ( Pawn != None )
                              Pawn.FaceRotation(NewRotation, deltatime); //notify pawn of rotation
                              }

                              exec function NextWeapon()
                              {
                              StayAlivePawn(Pawn).CamZoomOut();
                              }

                              exec function PrevWeapon()
                              {
                              StayAlivePawn(Pawn).CamZoomIn();
                              }

                              exec function BehindView()
                              {
                              if ( WorldInfo.NetMode == NM_Standalone )
                              SetBehindView(!bBehindView);
                              }

                              function SetBehindView(bool bNewBehindView)
                              {
                              bBehindView = bNewBehindView;
                              if ( !bBehindView )
                              {
                              bFreeCamera = false;
                              }

                              if (LocalPlayer(Player) == None)
                              {
                              ClientSetBehindView(bNewBehindView);
                              }
                              else if (UTPawn(ViewTarget) != None)
                              {
                              UTPawn(ViewTarget).SetThirdPersonCamera(bNewBehind View);
                              }
                              // make sure we recalculate camera position for this frame
                              LastCameraTimeStamp = WorldInfo.TimeSeconds - 1.0;
                              }

                              reliable client function ClientSetBehindView(bool bNewBehindView)
                              {
                              if (LocalPlayer(Player) != None)
                              {
                              SetBehindView(bNewBehindView);
                              }
                              // make sure we recalculate camera position for this frame
                              LastCameraTimeStamp = WorldInfo.TimeSeconds - 1.0;
                              }


                              DefaultProperties
                              {

                              }
                              i got no error but camera doesn't look on character

                              Comment


                                #75
                                about Bug Eye Zoom Around can i fix with old code right this
                                i don't know how to Applied on your code i just noob

                                //Linear interpolation algorithm. This is the "smoothing," so the camera doesn't jump between zoom levels
                                if (Dist != FreeCamDistance)
                                {
                                Dist = Lerp(Dist,FreeCamDistance,0.15); //Increment Dist towards FreeCamDistance, which is where you want your camera to be. Increments a percentage of the distance between them according to the third term, in this case, 0.15 or 15%
                                }
                                if (Z != TargetZ)
                                {
                                Z = Lerp(Z,TargetZ,0.1);
                                }
                                if (DefaultFOV != TargetFOV)
                                {
                                DefaultFOV = Lerp(DefaultFOV,TargetFOV,0.1);
                                }
                                if (Offset != TargetOffset)
                                {
                                Offset = Lerp(Offset,TargetOffset,0.1);
                                }

                                Pos = Loc - Vector(Rot) * Dist; /*Instead of using FreeCamDistance here, which would cause the camera to jump by the entire increment, we use Dist, which increments in small steps to the desired value of FreeCamDistance using the Lerp function above*/

                                Comment

                                Working...
                                X