Announcement

Collapse
No announcement yet.

PHYS_Falling Problem

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

    PHYS_Falling Problem

    When I press the jump button everything works fine, but when the pawn falls, the velocity of the Pawn dramatically increases... Has anyone ever experienced this kind of problem, or can anyone suggests a solution??

    Currently I'm using RootMotion, and I thought this could be the problem..

    video: https://docs.google.com/file/d/0ByoN...it?usp=sharing

    #2
    One thing you can do which is rather easy, is to use a new state for falling and then check the velocity of the pawn in tick function of that state. Something like this:

    Code:
    Function Bool DoJump(Bool bUpdating)
    {
    	If (bWallWalking && !bInAir) {
    		bInAir = True;
    		Velocity += JumpZ * Floor;
    		GotoState('PawnFalling');
    		Return True;
    	} Else {
    		Return Super.DoJump(bUpdating);
    	}
    	If ( !bUpdating )
    		PlayJumpingSound();
    	Return True;
    }
    
    State PawnFalling
    {
    	Event BeginState(Name PrevName)
    	{
    		//if (fallDir == vect(0,0,0)) {
    		//	fallDir = Floor;
    		//}
    
    		FallDir = Vect(0, 0, 1);
    		bDirectHitWall = True;
    		SetPhysics(PHYS_Flying);
    		.
    		.
    		.
    	}
    
    	Simulated Event Tick(Float DeltaTime)
    	{
    		Super.Tick(DeltaTime);
    		// Check the velocity here and constrain it if necessary
    	}
    (Don't try to copy/paste the code, it's just an example on how to approach.)

    Comment


      #3
      Is your jump system using ut pawn jumping or are you playing an animation and regulating movement yourself?

      What is your gravity factor?

      udkgame/config/DefaultGameUDK.ini

      Code:
      DefaultGravityZ= -470.0
      try lowering this value

      Are you using UT Pawn?


      It is odd that it only happens when your pawn falls off something without jumping

      I can only assume you have some unusual way of implementing your jumping feature

      ~~~

      Test Code

      please test value of physics of pawn every tick to see whether your pawn enters PHYS_Falling during your jump animations at any point

      Code:
      simulated function playerTick(float DT){
      local bool testing;
      
      super.playertick(DT);
      
      if(yourpawn.Physics == PHYS_Falling)
      testing  = true;
      
      ClientMessage("Physics State is Falling"@testing);
      }
      and let me know if your pawn is entering PHYS_Falling when jumping



      Solutions

      1. if pawn is NOT entering phys falling when jumping, this problem is simpiler, because whatever strange relationship your pawn is having to gravity can be uniformly adjusted with custom gravity factor of your pawn or using the ini file setting above.

      2. if pawn IS entering PHYS_Falling when jumping, then I have no idea what is going on

      Rama


      PS: By "root motion" do you mean you are not using standard pawn jumping mechanism and are playing animations where root bone is moved rather than adding velocity to pawn as with standard jumping?

      Comment


        #4
        unfortunately it actually enters in PHYS_Falling (I had already tested). I'm using Root_Motion for PHYS_Walking animations (e.g. walking, running...) and for jumping animations I discarded Z root bone translation. My idea was to use RootMotion to affect pawn velocity and then leave the jump mechanism, so that when you walk the jump is smaller than when you run.

        I'm extending UDKPawn, not UTPawn.

        DefaultGravityZ is -520, but since when I jump everything works fine I don't think that's the problem

        video: https://docs.google.com/file/d/0ByoN...it?usp=sharing

        Comment

        Working...
        X