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"

Walking Animation Blendspace directions

Hey there!

I'm adding new motioncapture animations to my fighting game project. I've run into an issue with my walk blendspace animations.

The Issue:

My game uses a shared camera with each actor looking at each other. The second players animations are not activating correctly. For example when moving backwards, its playing the forward animations. The first players animation seem to be activating correctly, but they could use some work.

What I have so far:

  1. 4 Different blendspaces foreach direction, all of which have 3 main animations For example: Forward, forward right, forward left.

  2. Basic Directional calculations that uses the "calculate direction" node and getting the actors "inversed transfrom direction"

What would be the best way to implement the blendspaces so that regardless of where the character mesh is facing it will always fire the correct animations? Should I be using Input axis values to determine which animation to fire?

Thanks in advance, SamuelB

Product Version: UE 4.17
more ▼

asked Jan 10 '18 at 02:37 PM in Blueprint Scripting

avatar image

283 9 19 22

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

2 answers: sort voted first

OK, I was able to fix the Directional issue by using similar calculation supplied by Jin_Ve in this post: https://answers.unrealengine.com/questions/738222/ai-check-which-direction-bot-is-moving.html

I created a function that calculates the correct direction of the players. For example, if a player is moving Backwards relative to the enemy player. the forward value will be between 0 and -1 etc. As for the blendspaces, I'll make another question if needed to keep this thread as short as possible and not getting side tracked too far.

Thanks again Jin_ve for your input!


more ▼

answered Jan 11 '18 at 03:22 PM

avatar image

283 9 19 22

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
  1. You should only need one blendspace.

  2. In my experience, using the speed/direction method ends up working better for all situations. I have a setup where you can free-run (camera not locked behind character) as long as you aren't aiming. When aiming the camera locks and you strafe. The only way I could do that with one BS was with direction/speed.

  3. You want to use the actor rotation to figure out which way is forward and which way is right. There are lots of resources explaining how that works. It involves getting a "forward vector" from the actor rotation and then multiplying the forward axis by that to get the relative forward motion. Same with the "right vector" from the actor rotation.

Try to get somewhere and if you're still stuck, let us know.

more ▼

answered Jan 10 '18 at 02:55 PM

avatar image

4.4k 32 79 42

avatar image Samuelb Jan 10 '18 at 03:22 PM

Hey again Jin_Ve!

Thanks for the quick reply! Its been sometime since i did blendspaces. The resources that are available are somewhat helpful, but the situation is abit different from my setup. I'll try using one blendspace for each stance, this would probably require me to redo my state machine. Do you see something wrong with my state machine setup?

alt text

So I'm guessing i can just set a single state from the entry point, which would hold my new blendspace containing each directional animations.


avatar image Jin_VE Jan 10 '18 at 03:37 PM

Oh, stances? Yeah, you want different blendspaces for different stances. I don't think there's a 3D blendspace. I thought you meant you were somehow using different ones for different orientations.

But what you're showing there seems weird. Are you using a 1D or 2D BS? Are you going for left/right/fwd/back motions only (no forward-left on an angle and such)?

Generally, you would use a single 2D blendspace for each stance (walking, crouched, in-cover, etc) and you only need one state in the AnimGraph to handle that. You'd have to explain why you're separating out the left/right/back motions.

(Edit: Technically, in-cover would probably be a 1D BS cuz you only need to go left/right)

avatar image Samuelb Jan 10 '18 at 04:14 PM

My setup is pretty old, like a year old or something. I think it was setup like this before i was using blend spaces., so that i would activate each animation with booleans. I guess i just have to make a blend space for each stance( there are 4 different stances). I'll report back asap when i've tried it out. Thanks again Jin_ve!

avatar image Samuelb Jan 11 '18 at 11:40 AM

Seems like i didn't answer the question: "Are you going for left/right/fwd/back motions only (no forward-left on an angle and such)?". So I have 8 different directions for each stance F,B,R,L,FL,FR,BR,BL. Should I stick them all into one blendspace or create 2 for backward and forward directions? I'm using a 2D Blend Space.

EDIT: I just realized i major flaw in my movement mechanics. My characters are looking at each other, so the input axis are of course reversed on the second player. So whenever the 2nd player is trying to activate a forward animation, it activates a backward animation. This is due to that i was previously using a camera component attached to each actor. With the new shared camera i'm using, i'll have to recalculate the direction so that each the input values are always the same relative to the players rotation.

I'm attempting to use the same vector calculations you helped me with on the bot animation inputs. So far it seems to be giving correct values for each player. So whenever one of the players is moving back the forward value will always be -1 for each player. I'm going to use these values to set the animation booleans, this should fix the animation issue i think.

avatar image Jin_VE Jan 11 '18 at 03:44 PM

Sounds right. You want to make the characters work as if there was no camera. They should be moving relative to themselves. Then you can rotate them any way you want (like relative to a camera) and they will always play the right animation.

You want a single blendspace with all the animations for that stance. There are tons of tutorials going through it.

avatar image Samuelb Jan 12 '18 at 11:15 AM

Ok cool, i'll look into that blendspace stuff later! thanks

(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