x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Walking to Falling Transition Behaviour

When my character transitions from walking to falling by running off an edge there is a noticeable change in direction that makes him do a small jump. This behavior can also be seen in the standard 3rd person character template, but the direction change is a bit more obvious on downward slopes with higher speed.

How would I get a character to slide off an edge (transition from walking to falling) and have their trajectory maintained?

alt text

Product Version: Not Selected
Tags:
more ▼

asked Nov 25 '14 at 10:02 PM in Using UE4

avatar image

Drocks
18 3 7 9

avatar image TJ V ♦♦ STAFF Nov 26 '14 at 05:16 PM

Hi Drocks,

I just tested this in the default 3rd Person template in 4.5.1 and couldn't get your results. The MyCharacter slides fluidly off of every angled slope that I've test.

In the MyCharacters detail panel, did you set anything to a non-default option?

avatar image Drocks Nov 26 '14 at 07:16 PM

Thanks for looking into this TJ :)

Here is what I have done to reproduce the behavior:

  • Create new 3rd person template project

  • Adjust some geo to be on a 45 degree angle (running down slopes makes the issue easier to see)

In the character blueprint defaults:

  • Change walkable floor angle to 75 (just so it doesnt go into a slide and lets you walk off the edge of the slope instead)

  • Change Max Walk Speed to 1500 (higher speeds make the issue more apparent)

In the HeroTPP_AnimBlueprint:

  • Delete all nodes in the state machine under the Anim Graph so the player remains in T pose and animations wont get in the way of seeing how the capsule behaves.

I then run down the slope and transition from walking to falling. When this happens it looks like the player character pops up a bit.

It does seem like the character's z velocity is interpolating up from 0 when this transition occurs, but the x and y remain constant, giving the bounce like transition?

Thanks again for your help!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi Drocks,

Thanks for the specific repro steps. I was able to reproduce the issue and I have created JIRA UE-6035 in our tracking software. Our developers will be looking into it further.

I am also working with another developer to try to find a workaround. I'll post back here as soon as we have something.

Cheers,

TJ

more ▼

answered Nov 26 '14 at 10:21 PM

avatar image

TJ V ♦♦ STAFF
41.1k 1009 183 493

avatar image zeroexception STAFF Nov 26 '14 at 10:33 PM

I think this happens because we always store your velocity when walking as a horizontal velocity only, so when you transition to falling you are getting an initial horizontal velocity. You can work around this by hooking in to the "OnWalkingOffLedge" event and setting velocity to the result of "GetPhysicsLinearVelocity()" from the Character capsule.

You may only want to do this when moving downward, otherwise you may find that you start launching in the air when running off upward slopes (unless that it something you want).

Thanks for the image, that helped see what was going on quite easily :)

-Zak

avatar image Drocks Nov 27 '14 at 12:37 AM

Thanks for the help TJ and Zak, that worked!

avatar image zeroexception STAFF Mar 27 '15 at 06:15 PM

Just to update this: I checked in a change for 4.8 that affects this (for the better). We can't just change the current default behavior without affecting too many existing projects, so instead I made it easier to compute custom velocities in the OnWalkingOffLedge() event and removed some barriers in character movement:

  • Added more parameters to OnWalkingOffLedge (previous floor normals, old location before movement, and timestep) so it's easier to compute a custom velocity based on the change in location. GetPhysicsLinearVelocity() is still fine, just beware that under 30fps you need to enable physics substepping for it to be consistent.

  • CharacterMovementComponent::StartFalling no longer forces a zero Z velocity, so custom velocities will be respected.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question