Announcement

Collapse
No announcement yet.

Pawn Wall walking and directional gravity

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

  • replied
    ah lol ok
    When i assign Spider to my pawn, it runs to a specific height, but i stays there and cannot walk more up

    Leave a comment:


  • replied
    Cheers for that I'll have a read. To be honest the PHYS_Spider thing isnt as incomplete as people think, the only thing I've had to do (although it took me ages to find out) is make a player controller with a walking state and a falling state, the falling state uses phys_flying and a function called every tick to make the player fall. All you need to do is keep trace of the last floor the pawn was on before it left it so you can use that for the gravity direction.

    The walking state just requires that you calculate the pawns new acceleration perpendicular to the current floor normal, I will update that though because at the minute when the pawn runs all the way around onto the ceiling you end up with left = right and visa-versa.

    Leave a comment:


  • replied
    http://chimeric.beyondunreal.com/tutorials/tut27.php
    That`s a tutorial abou the PHSY_ states and i read it that way, that you would have to set it to PHYS_None, if you wish to use SetLocation()
    How did you come this far by now anyways?

    Leave a comment:


  • replied
    I always end up double posting lol

    I've tried another way to get this working, I've disabled the collision cylinder completely and the skel mesh collision. The PHYS_Spider physics works well then but obviously without collision it just places the pawn at its centre point along the surface.

    So I wrote this function to offset it away from the wall and put it inside the Tick event of the pawn.

    Code:
    /** Offsets the pawns location to make the feet be on the floor */
    function OffsetPawnFromFloor()
    {
    	local Vector NewLoc;
    
    	if(Physics == PHYS_Spider)
    	{
    		NewLoc = Location;
    		NewLoc -= FeetOffset * TransFormVectorByRotation(Rotation, Vect(0,0,-1));
    
    		SetLocation(NewLoc);
    	}
    }
    In the tick function its done after everything else so hopefully the physics calculation will have already taken place

    Code:
    event Tick(float DeltaTime)
    {
    	super.Tick(DeltaTime);
    
    	OffsetPawnFromFloor(); // move pawn above floor (as no collision cylinder/mesh is being used)
    }
    But this isnt working. It appears that as soon as you use SetLocation while in PHYS_Spider, the Physics are changed straight to PHYS_Walking.

    Any other ideas, really this is the only thing that is stopping this from working atm.

    Leave a comment:


  • replied
    Ive been trying a trace downwards (depending on the pawns rotation) and using SetLocation but it comes out with some undesired results.

    With the PHYS_Spider its working fine with collision.... but only aslong as I dont rotate the pawn(and its collision mesh). As soon as I rotate the pawn to so that its feet are on the wall too the collision mesh starts getting stuck in things when it appears to not even be touching them.

    Leave a comment:


  • replied
    Mhh, that's still strange.
    Maybe trace downwards while moving to check if your collisionbox is too far away from the ground" then you could move the pawn closer there?

    Leave a comment:


  • replied
    Progress is going really slow with this again, I've gone back to trying to get the PHYS_Spider working again.
    It works fine apart from the collision issues I'm having shown in this video:
    http://www.youtube.com/watch?v=Q9dTbAn72FY

    The collision is, 1 making it get stuck sometimes and 2 pushing the pawn too far away from the floor in some cases.

    Leave a comment:


  • replied
    wow I am impressed, what approach have you used for the wall climbing?

    Leave a comment:


  • replied
    Hey! we are working on this too!

    http://www.youtube.com/watch?v=OIxzuBX2q_g

    Leave a comment:


  • replied
    Ah ok, ill code that later as the flying animation is starting to annoy me so I want to make it run now. I made a copy of the AnimTree but upon editing the tree and attempting to save I get a warning telling me there are unlinked nodes and then when I try and reopen the tree it crashes.

    Atm I'm deleting all the stuff after the 'Flying Node' where it connects to the flying input and then connecting that to the normal running stuff. I've even tried copying and pasting the running stuff to use as I tohught that might be making it crash but still no luck.

    Leave a comment:


  • replied
    Originally posted by mwadelin
    Cool! I didn't know about this.

    Originally posted by mwadelin
    Thats why I'm trying to use the acceleration the only problem is PHYS_Walking handled the slowing down of the pawn after letting go of a button PHYS_Flying needs me to program it in and Im not sure how.
    There is no deceleration support for pawn physics. What I did for this case is set max acceleration and slowly decrease AirSpeed.

    Leave a comment:


  • replied
    I see... maybe if movement buttons aren't pressed, you decelerate?
    And instead of ".acceleration = blehblah" just "velocity += bleh*bleh*deltaTime"

    Leave a comment:


  • replied
    this is different though, the player will be walking on the surface not hanging from it, so it the player constantly walked at a fixed speed as soon as a button was pressed it wouldn't look too good. Thats why I'm trying to use the acceleration the only problem is PHYS_Walking handled the slowing down of the pawn after letting go of a button PHYS_Flying needs me to program it in and Im not sure how.

    Leave a comment:


  • replied
    You should set your velocity / acceleration :P
    I tried using acceleration for my movement but it was borky, so I just set acceleration to 0, and velocity to 0 at start, then if I pressed A or D on my ledges I set velocity to 200*movement vector and that worked nicely.

    Leave a comment:


  • replied
    yeah that was what was causing the problem, the MinHitWall value. I'm now just stuck with slowing down the player. The PHYS_Walking took care of the deceleration of the pawn when the player is not holding down a movement button but with PHYS_Flying its like the player is running on ice.

    Leave a comment:

Working...
X