Better Way to Set This Up & Fix Editor Errors?

Below is located inside my CharacterBP.

My character uses Root Motion and right now, this BP setup will mean I can:

  • Tap WASD and a start animation will
    play through without interruption.
  • Keep holding WASD or proceed to press
    and hold WASD during anytime of the
    start animation to keep going to
    locomotion.
  • Release WASD to play a stop animation
    without interruption.
  • Then blend back into Idle no matter
    what.

Basically the HoldMovement bool will assure the proper start or stop animation plays (what is pressed or released will set the animation) no matter after the fact how the player pushes WASD.

What I want to be able to do is:

  • Break out of start animation to go
    back to idle.
  • Break out of stop to go back to
    locomotion.
  • Break out of idle faster and not
    force it to play after the stop
    animation has played.

How can I achieve this by setting up correctly my CharacterBP?

The errors this gives inside the editor are:

Accessed None trying to read property K2Node_DynamicCast_AsAnimBP from function: ‘ExecuteUbergraph_AnimBP’ from node: SetMoveForward in EventGraph in AnimBP

There is some error with the set Move and User vars

Drag a node from the bottom Cast and type isValid.

Place the isValid check in front of set MoveForward.

Connect IsValid to set.

The error means: You are trying to set MoveForward variable on NULL reference.

You need to connect your AnimBP to your input object of the isValid. That’s what you’re checking to make sure it’s valid.

If you are getting an error, you are getting a different error than the one you posted.

Apologies. I meant AnimBP, but the error actually reads:

Accessed None trying to read property K2Node_DynamicCast_AsAnimBP from function: ‘ExecuteUbergraph_CharacterBP’ from node: SetMoveForward in EventGraph in CharacterBP

Instead of the AnimBP, pass it the “GetAnimInstance” for the isValid input.

If you want transitions between your idle and walk animations, I greatly suggest using Animation Blending

I have transitions setup, but they cannot be interrupted. I need a way to go from start to idle, stop to locomotion, and break out of idle into start/locomotion

There is no way to commit start, locomotion, stops and idles into one blendspace…especially if you have different stances. There is no way to say if time remaining for a coordinate on a blendspace, clamp the MoveForward/MoveRight value differently to time playing the next phase of animation right after that coordinate finishes playing.

The above BP is how I enter each transition (how it is timed and such) utilizing AnimBP Tree

However I can’t exit these stages because WASD is locked or stored and waiting for certain stages to exit or begin (notifies) so that the proper start and stop animations play.

Basically “Hold Movement” bool is true when I ENTER start phase
“Hold Movement” bool is false when I EXIT stop phase

UserForward & UserRight are the last known values of MoveForward & MoveRight so start and stop can play the correct animation when WASD keys are pressed (for start) and released (for stop)

MoveForward and MoveRight will update locomotion direction and will not change or affect starts and stops.
These vars are clamped inside AnimBP to play the corresponding animation inside the blueprints (since I am using root motion to drive speed and such, blendspaces use MoveForward and MoveRight x and y axis values from -1 to 1)

How can I add to this CharacterBP setup so that:

-pressing WASD

  • when idle is playing after stops,
    break to starts
  • during stops, move back to locomotion

-releasing WASD

  • during starts, move back to
    locomotion