Advanced Locomotion System V3

Hey, sorry for the delay. So it seems to me like you are doing a little more work than really needed. Ill work you through how I would do it If I were to add crouching.

So first off, I would most likely create a new Enum called something like “Body Position”. I would add 3 enumerators, Standing, Crouching, and Prone. This would help to keep things more organized in the long run so I wouldn’t have to deal with a bunch of Booleans.

Capture1.PNG

Then, I would add that enum to the Component, and make a new custom event allowing me to switch it. I would also call the Update Camera Dispatcher and fire the Update Movement Speed Event.

I could then feed that Enum into wherever I wanted in any graph, similar to how locomotion state works.

In the CharacterBP I could use the Input action to call the event in the component, and set it to toggle Standing or Crouching.

Capture1.PNG

Now that the neccessary logic has been added to switch the Enum, I could add it into the AnimBP, so that it can be used there. Then I would make sure the value would get updated properly. The easiest way to do that would be to add it in the ‘Get Variables From Pawn’ function, and update it to whatever the value from the component is.

At that point I would be free to add that enum anywhere I please into any part of the Event Graph or Animgraph, again, similar to locomotion state. Its actually really simple to get the animations working properly. Because the Grounded State Machine is pretty basic, and contains neccessary transitions for Idle, Moving, and Stopping, there is no reason to add another state exclusively for crouching. It could share all the same states as normal locomotion, since the transition logic is all the same. In the Moving state, I would add a Blend Poses by Enum node using the Body position Node, and then hook up the proper blendspaces, making sure to add them to the ‘Locomotion’ sync group so the feet cycle properly when blending.

For Idle, its all up to you and how you want your Anims to blend together. You could add a completely new Idle state, and add the nessecary transitions (also add crouching to the Idle Entry Enum)…

Or, you could add the crouching anim into one of the idle states, if the blending works. All up to you.

Also, for stopping, I would just add another selector with Body Position and add the appropriate anims.

Hopefully this sets you on the right track. Once you start working with it more you will understand how flexible the system is designed to be. Let me know if this helps!

Wow, thank you …

I was adding Crouched Idle and Crouch Movement States, and it did feel like I was duplicating a lot of work. I will go back and try it the way you suggested.

Much appreciated

Moving along, but ran into a snag. On the Player Input Graph, not getting Switch Body Position “functions.” Then on the Get Variables from Pawn, I am getting an error, asking for a valid target.

Help!

Ok, not sure what you mean by you arent getting the functions in the input graph. As far as the Body Position target, you shouldnt need one. If you create a new Enum in the animBP using the Body position enum, then you can set it. Just make sure you add the Enum in the AnimBP and you shouldnt need a target.

Ya, I am a bit brain dead right now … in your example the Switch body positions are “functions” … how did you create them … because when I drag out the from the switch on body position, all I can select are events, and from my limited understanding, events can’t have any output? I though that might be part of the problem. Or am I just an idiot?

function.PNG

Created the Body Position in the AnimBP, set it, and that worked.

Target.PNG

Any guidance on the Events vs Functions for Switch Body Position?

NASA we have Liftoff! … or should I say crouching. Once you catch on to the ALS system, it is so easy to build upon, just like you said. Tomorrow I will try Prone, then Swimming, ledge grab, the Parkour anims I procured, moon walking …

Crouching.PNG

Crouched.PNG

Well I would use a Custom event, but Im sure a function would do the same thing. Create it in the component, and call it from the CharacterBP.

Just cleaning things up … for anyone following this, you will also need to add Body Position, Blend Poses, with the appropriate “Crouch Idle” Anim, to the GroundedLocomotion > Stopping (state), or the ALS_Idle Additive will cause the character to stand up to the idle position from crouch moving, before stopping in the crouch position.

Once add, you you can move in crouch and stop directly in crouch, smooth as butter.

Stopping.PNG

Still working on reversing my Crouch foot forward to fit better with Locomotion State 3, and adding the “crouch slide” when sprinting and hitting the crouch button.

Question for KingTumTum101 …

I am starting work on adding Prone. Any idea on how to check to see if there is enough clear space to go Prone, to avoid “glitching” and unwanted prone positions, before transitioning into Prone? And when there is a blockage, feed up to the UMG a “Prone Blocked” message, like we see in Black Ops?

By the way, love watching my crouching character’s head turn the direction of the camera when in Locomotion state 2, thanks to ALS … without any additional effort on my part. This system really works great. Thanks for all the tips on adding Crouching.

The stopping state issue is most likely because an appropriate anim isn’t being selected on the stop transition (which fires the stopping anim notify event). But the way you have it now works too. The crouch slide could be done via a montage. Or a separate state could be added off of the moving state. Whichever works best in your case. Theoretically, the grounded state could get as complex as you need it to be, with more transitions and states for different actions, and it would still work well with the system as a whole because it is just inside the the grounded state.

Also, to be more clear about the function thing, I’m actually not sure why it says it’s a function. I didn’t notice that. I created a custom event imside the component which could set the enum, and then in the characterbp I got the reference to the component and dragged off of it to fire the custom event. Hopefully that straightens everything out.

Makes sense,

And thoughts on “I am starting work on adding Prone. Any idea on how to check to see if there is enough clear space to go Prone, to avoid “glitching” and unwanted prone positions, before transitioning into Prone? And when there is a blockage, feed up to the UMG a “Prone Blocked” message, like we see in Black Ops?”

When I sprint, then hit the crouch button, he actually studder steps, quickly shortens his steps, and slows down right into the crouch. Looks really cool. Want to keep that look, so I will need to use press and hold crouch button perhaps to enter the slide.

No, not off the top of my head. I havent done much experimenting with prone at all, so I’d have to look into it. My best guess would be to add an extra collision volume or something, and check if it’s blocked. Other than that I’m not sure.

HI! - I love the system but I am having one small problem

I have my own character, if I leave a physics body on the root bone then ragdoll makes the guy fly up in the air non stop… if I remove the root physics body thing, then he ragdolls OK, but then the get up animation does not play on the floor (sometimes in the air, sometimes through the floor) - and also the camera gets “disconnected” - meaning, after getting up, I can run, but the guy doesn’t move and the camera does - and I also get errors in the log that say “Attempting to move a fully simulated skeletal mesh, please use the teleport flag”

Any ideas what I missed? :slight_smile:

So, the most likely issue is that you haven’t freed the linear constraints on the hip bone. Because of this, when the actor gets moved to the pelvis location, it brings the root joint along with it, but since the linear constraints on the pelvis are locked, it fights to stay above the root joint, resulting in your character gettin launched up in the air. Also, don’t forget to disable any collision on the root physics body, since it will go inside the pelvis physics body.

As for the error, that’s my mistake. I forgot to switch a node before I updated it. If you go into the component, find the Manage Movement modes graph, inside it find the Event tick events, open up the Ragdoll graph, and near the end you should two nodes, one not being used. Switch the input to the one not being used and you should be good.

Ahhh that was it! Thanks a ton! :slight_smile:

I noticed ALS has something like 60 ratings on the Marketplace … that is a lot of sales. I hope “character” Sellers are paying attention … because it would be great if we had a larger selection of “advanced” characters in civilian, adventure, beach, sci-fi, and space clothing … because the ALS system looks fantastic when you dump the Mannequin. And I need lots of Characters for NPCs.

By “advanced,” I mean characters like we have seen in every game published for the past 8 years or more … with facial bones, teeth, eye and mouth morphs for dialogue and expressions, hair that moves, some clothing that moves, proper “female bits” that “move” correctly … and the EPIC/Paragon eyes and eye and hair shader … and characters designed with ALS and advanced features in mind.

Just saying …

Need advice on one more crouching issue. In Locomotion States 2 and 3, when Idle and crouching, when I enter Turning in Place, he will stand, turn, then crouch.

To fix this should I add something to the TurnInPlace AnimNotifyState? or Idle State on Ground Locomotion? or the nested animation IdleStateMachine?

Any thoughts?

Do you have any crouch turning animations?

Yes, I have left and right, 45, 90, 135, and 180