I have a character controller. I am primarily using FSM with the animations and blends. However, I am running into some trouble with the fall.

I walk up to a ledge and walk off...sometimes I will make it off the edge and the falling animation will play...but sometimes I get stuck halfway off the edge.

Also, the falling animation completely disregards any motion vectors I had prior to transferring to the falling state.

Is there a way to transition to fall, retaining the current x-y velocities?

In an effort to fix this, I tried giving the attached rigidbody a force vector slightly up and in the direction of travel so that the character gets a little hop over the edge...but again, no luck.

  • \$\begingroup\$ It might help to have a screenshot of how it's "stuck". If the player dies after this fall and respawns (the object is destroyed), you may want to consider moving it to another layer that won't collide, or disabling the physics on the player object during the fall. \$\endgroup\$ Jun 13, 2016 at 17:07
  • \$\begingroup\$ @JesseWilliams The "sticking" isn't a problem. I just transition into the fall animation, then back again if the downward velocity stops increasing. The issue is continuing the motion of the character before the fall into the fall--so that instead of falling in a straight line, the character retains his momentum and falls in a parabola like real life... \$\endgroup\$
    – Chris
    Jun 15, 2016 at 13:06
  • \$\begingroup\$ If you're using the Unity physics engine, this shouldn't be an issue - though you may want to decrease horizontal velocity as vertical velocity increases to your gravitational norm (default 9.8). I'm not sure what it would look like, but you would probably want to decrease it by an inverse of the increase so that if/when vertical velocity hits 9.8, horizontal velocity reaches 0.0. \$\endgroup\$ Jun 15, 2016 at 13:49
  • \$\begingroup\$ Actually, 9.8 is gravitational acceleration (sorry, still tired). But an inverse to maximum vertical velocity would still make sense. It would end up being a rather smooth curve, but should prevent any oddities where the object falls in an increasingly steep diagonal line. \$\endgroup\$ Jun 15, 2016 at 13:51
  • \$\begingroup\$ @JesseWilliams I think it should be some sort of settings thing, because the thing is, the animation just falls in exactly a straight line down, according to gravity. So physics is only applied in the Y axis. The motion is generated with the root motion of the animation prior to the transition to the fall... \$\endgroup\$
    – Chris
    Jun 15, 2016 at 15:46


You must log in to answer this question.

Browse other questions tagged .