Announcement

Collapse
No announcement yet.

PHYS_Falling

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

    PHYS_Falling

    Hi all,

    Somebody can explain me how work the change from PHYS_Falling to PHYS_Walking.

    In my case with a custom Spawn class, they never change to state PHYS_Walking.
    The state PHYS_Falling is set all the time.

    Can be CylinderComponent.CollisionHeight, gravity ?


    Sorry for my english.

    Thank in advance.

    #2
    Code:
    function Possess(Pawn aPawn, bool bVehicleTransition)
    {
         Super.Possess(aPawn, bVehicleTransition);
    
         if (Pawn.Physics == PHYS_Falling)
         {
    	   Pawn.SetPhysics(PHYS_Walking);
         }
    }

    This is just an example using the controller class to set the Physics of the pawn it has posses, there are many other ways but you should get the idea

    Comment


      #3
      i think if you set them to phys_falling they'll remain that way until code explicitly changes it back .. but if you set them to phys_walking, they'll switch to phys_falling when they drop off an appropriately sized drop, and resume phys_walking when they land...

      i could be very wrong about that, too.

      Comment


        #4
        Thank for the fast reply.

        So i must to change the PHYS state manually to walking or what else?

        Then what i must to do is in my control, if i want to move, change my state to walking.

        I have supposed, the engine internally will change the state if the pawn have a destination, etc..

        thank.

        Comment


          #5
          If the pawn's state is PHYS_Falling, it will fall until it reaches a walkable surface, at which point the pawn will get the UnrealScript Landed() event. If you don't change the pawn's physics in this event, it will automatically change to PHYS_Walking. If the pawn does not ever land on a valid surface (based on the Z component of the normal of the surface being greater than the pawn's WalkableFloorZ), then it will not change physics. Your level geometry could cause this, if the pawn landed in a hole all of whose walls were to steep to walk on.

          Comment


            #6
            I do, but I give does not work

            Comment


              #7
              Thank to all, for the info.

              I have found the problem, In my custon pawn derived from UDKPawn the default value for CustomGravityScaling is 0.

              Thank.

              Comment


                #8
                Good catch - I updated the default value for UDKPawn to avoid this issue in the future.

                Comment

                Working...
                X