Results 1 to 8 of 8
  1. #1
    MSgt. Shooter Person
    Join Date
    Dec 2009
    Posts
    149

    Question How to Limit Directional Influence in Air

    Thanks for your time.

    By default, Unreal allows the player to influence their direction in the air by pressing wasd (or arrow keys). You get a constant speed boost, and it's almost instantaneous, which is highly unrealistic.

    More power to you if you want something like that, but I'm shooting for absolute realism here, where you can influence just a little bit, but nothing like the massive speed boosts you get now.

    Can anyone help me understand how to limit this while in the air? I want to keep "PHYS_Falling" if possible, and it makes sense to stay in the PlayerWalking state. I know that it has something to do with PlayerInput.aForward, PlayerInput.aStrafe, the Pawn's Velocity X and Y vectors (relative to the world?).

    Thanks in any case,
    --AHF

  2. #2

  3. #3
    The Sacrifice
    Join Date
    Jul 2011
    Location
    Sweden
    Posts
    370

    Default

    Quote Originally Posted by AwesomeHighFive View Post
    More power to you if you want something like that, but I'm shooting for absolute realism here, where you can influence just a little bit, but nothing like the massive speed boosts you get now.
    Absolute realism would be no influence at all. (AirControl=0.0)

  4. #4
    MSgt. Shooter Person
    Join Date
    Dec 2009
    Posts
    149

    Default

    Added line "airControl=0.0f;" to the end of MyPawn :: DefaultProperties with no change in functionality. Mind you I do want a little bit of "nudge" (I figure you can lurch sideways in the air a bit even if you're falling, waving your arms like a maniac, etc) but I wanted to test it at absolute 0 just to see if it had any effect at all, but it doesn't seem to.

    Maybe this variable is named poorly, or archaic?
    Last edited by AwesomeHighFive; 07-18-2012 at 01:59 PM.

  5. #5
    The Sacrifice
    Join Date
    Jul 2011
    Location
    Sweden
    Posts
    370

    Default

    Which pawn class are you extending?

  6. #6
    MSgt. Shooter Person
    Join Date
    Dec 2009
    Posts
    149

    Default

    UTPawn - the last one before DummyPawn.

  7. #7
    The Sacrifice
    Join Date
    Jul 2011
    Location
    Sweden
    Posts
    370

    Default

    Well, as you can see here, whenever a UTPawn lands the AirControl is reset to DefaultAirControl.

    Code:
    event Landed(vector HitNormal, actor FloorActor)
    {
    	local vector Impulse;
    
    	Super.Landed(HitNormal, FloorActor);
    
    	// adds impulses to vehicles and dynamicSMActors (e.g. KActors)
    	Impulse.Z = Velocity.Z * 4.0f; // 4.0f works well for landing on a Scorpion
    	if (UTVehicle(FloorActor) != None)
    	{
    		UTVehicle(FloorActor).Mesh.AddImpulse(Impulse, Location);
    	}
    	else if (DynamicSMActor(FloorActor) != None)
    	{
    		DynamicSMActor(FloorActor).StaticMeshComponent.AddImpulse(Impulse, Location);
    	}
    
    	if ( Velocity.Z < -200 )
    	{
    		OldZ = Location.Z;
    		bJustLanded = bUpdateEyeHeight && (Controller != None) && Controller.LandingShake();
    	}
    
    	if (UTInventoryManager(InvManager) != None)
    	{
    		UTInventoryManager(InvManager).OwnerEvent('Landed');
    	}
    	if ((MultiJumpRemaining < MaxMultiJump && bStopOnDoubleLanding) || bDodging || Velocity.Z < -2 * JumpZ)
    	{
    		// slow player down if double jump landing
    		Velocity.X *= 0.1;
    		Velocity.Y *= 0.1;
    	}
    
    	AirControl = DefaultAirControl;
    	MultiJumpRemaining = MaxMultiJump;
    	bDodging = false;
    	bReadyToDoubleJump = false;
    	if (UTBot(Controller) != None)
    	{
    		UTBot(Controller).ImpactVelocity = vect(0,0,0);
    	}
    
    	if(!bHidden)
    	{
    		PlayLandingSound();
    	}
    	if (Velocity.Z < -MaxFallSpeed)
    	{
    		SoundGroupClass.Static.PlayFallingDamageLandSound(self);
    	}
    	else if (Velocity.Z < MaxFallSpeed * -0.5)
    	{
    		SoundGroupClass.Static.PlayLandSound(self);
    	}
    
    	SetBaseEyeheight();
    }
    You need to change DefaultAirControl also.

    Code:
    defaultproperties
    {
    	AirControl=0.0
    	DefaultAirControl=0.0
    }

  8. #8
    MSgt. Shooter Person
    Join Date
    Dec 2009
    Posts
    149

    Default

    You made me feel like this.



    <3
    Attached Images Attached Images


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.