Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Crouching Interpolation

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

  • Crouching Interpolation

    So i got the custom player controller:

    Code:
    class APlayerController extends UDKPlayerController
    	config(UberGame);
    	
    function CheckJumpOrDuck()
    {
    	Super.CheckJumpOrDuck();
    	
    	if(Pawn != None && (Pawn.Physics != PHYS_Falling && Pawn.bCanCrouch))
    	{
    		Pawn.ShouldCrouch(bDuck != 0);
    	}
    }
    
    defaultproperties
    {
    	InputClass=class'Arilienta.APlayerInput'
    }
    Custom input:

    Code:
    class APlayerInput extends UDKPlayerInput within APlayerController;
    
    var float LastDuckTime;
    var bool bHoldDuck;
    
    simulated exec function Duck()
    {
        if(APawn(Pawn) != None)
        {
    	if(bHoldDuck)
    	{
    		bHoldDuck = false;
    		bDuck = 0;
    		return;
    	}
    		
    	bDuck = 1;
    		
    	if(WorldInfo.TimeSeconds - LastDuckTime < DoubleClickTime)
    	{
    		bHoldDuck = true;
    	}
    		
    	LastDuckTime = WorldInfo.TimeSeconds;
        }
    }
    
    simulated exec function UnDuck()
    {
    	if(!bHoldDuck)
    	{
    		bDuck = 0;
    	}
    }
    And in my pawns default properties:

    Code:
    CrouchedPct=+0.4
    CrouchHeight=29.0
    CrouchRadius=21.0
    bCanCrouch=true
    Those were copied from the UTPlayerController, UTPlayerInput and UTPawn. Player crouches fine, but there is no camera interpolation so it appears that player instantly (un)crouched. I looked through UTPlayerController, UTPlayerInput and UTPawn but didn't find anything on this matter. Any ideas how to solve this?
Working...
X