Sprinting and Crouching Problem

Before adding crouch, sprinting worked fine. After I added crouching, the animation doesn’t play and my character floats when crouching. Sprinting also stopped working after that. Not sure what broke.






We can start with a few checks:

  1. What is the condition to transition from Idle to Crouching, then what is the condition to transition back?
  2. Does your input correctly set such state (is sprinting, is crouching etc.)

other systems mentioned such as the stamina drain screenshot I regard as overcomplication for debugging purposes. Debugging is easiest when done in a simple environment, we can build from there on.

You can put breakpoints on blueprint nodes by pressing F9, then the game will pause when code of that blueprint node is executed and you will be able to read the state of the properties at that time. This can help debug if nodes are executed and if property values are set to intended values. If within the animation blueprint, make sure to debug the runtime character.

The glitching movement up and down through the floor I can’t explain in current context. The character appears to remain in walking state. (not jump, crouch, sprint) unless that animation is the same.

I can make an estimation of the problem, which is that you are altering the capsule half height over time over a timeline. It might be solved if you don’t interpolate the capsule size. Try to snap the capsule height to a single value right before you start to play the timeline, then reset it back to the default value when the timeline finishes.

I figured out the sprinting by adding a branch to my movement speed function, and I also got the player to correctly play the animations. However, the character starts floating in the air when the animations play unless he’s under a platform, where he stays grounded.

Are you still setting capsule height with a timeline?

yea, i think i need it to make sure the collision works with surfaces,

I figured out a way to make it work by just searching for a video with the built-in crouch node from Unreal. I appreciate you replying and trying to help me out!