Help, please! Calculate Direction node issues.

Hi! How’s it going? It’s Amy P from UDK forums :slight_smile:

I’m migrating my Third Person Shooter game from UDK to Unreal 4 and I’m facing really annoying problems. I’ve never asked for help when I was using UDK, not a single moment. However, Unreal 4 is kicking my b… head… hard. I’m an artist, not a programmer. Please, forgive my rough coding terms ahead.

MY QUESTION: Set Direction isn’t working in Event Graph in Blueprint Animation. Apparently, only Set Speed is working. I tried multiple “fixes” I read over the internet and no set up is working for me.

I hit the wall in a very simple function: Calculate direction. I tried THIS and THIS to fix the Exec. node missing. No joy.

It’s one of my setups (ONE of them, because I tried to connect Set Speed and Set Direction in different order, casting different characters like Cast to Character and Cast to ‘my character’):

I started with a simple locomotion system that I can change States with the player equipping a pistol… in theory:

For WALK State, I have this (A simple blendSpace1D with movement based on Speed):

For COMBAT State (the player equips weapon and the pawn moves like in “Use Controller Rotation Yaw” is checked like in any shooter, you know. It’s a BlendSpace based on Direction and Speed):

Here’s my Blendspace based on direction and speed variables:

Equip Weapon in my Blueprint character class (Yeah, I setup an Input, assigning key ‘E’ for the equip weapon button):

For this issue, I’ll try to create other states without using Calculate Direction in Locomotion. I know it’s doable, but I would like to understand what’s going on first.

Any hint, dev buddies? :slight_smile:

Thank you!

Pfft. Forget about it. I’ve changed the whole logic. I added blend bones in the Default state in the AnimGraph and linked them to bones and functions like equip weapon:

Event graph:

Can’t say this topic was solved, because I had to change the code, starting from the scratch to have things working properly. But, that’s it, buddies. Calculate Direction node in new versions didn’t work for me.

See you in my next post when I open my WIP thread :slight_smile:

Thanks!

(Hahaha, yeah, I insisted on finding the answer even with me changing the whole code to avoid Calculate Direction. And I found the answer).
I found what was wrong with my Calculate Direction. If anybody had the same problem, the answer is: Add the rest of blueprint connections AFTER SET DIRECTION (with Set Speed linked to Set Direction). Some tweaks later and the Blueprint is working now in the AnimGraph.

Hi Amelia_P I am having an issue with the Calculate Direction node.

I am going through the:

Unreal Engine 4 Documentation > Gameplay Guide > Setting Up Character Movement > Setting Up Character Movement in Blueprints > 5. Animation Blueprint - Idle and Walk States

In this tutorial the Blueprint seems not compatible with 4.22 as when I try to build this Blueprint * see attached. The only available Calculate Direction node is green and shows incompatible with the output from Cast To MyCharacter.

Do you know why this is happening? I tried disabling context sensitivity and cannot find a Blueprint Node that is Blue in color and called “Calculate Direction” as shown in the Gameplay Guide.

Sorry! The Message Center hasn’t warned me about this post. I answered you via PM, but I’m pasting the answer here for anybody who wants to know how to do that.

"I’m an artist, not a coder. So I’m sending you my BP_anim printscreen. As far I could notice, you just missed a connection in your BP. Here’s mine:

My “CastToJoker” is a custom variable extended from “CasttoPlayerCharacter”

I’m not using this method anymore, so I didn’t go further in this process. Here’s another way to do this:

https://www.youtube.com/playlist?lis…NKuDQKzuj9LG78

In this tutorial, I found out we can do all the movement without changing and blending direction in Event Graph. We can code in Anim Graph to tell the engine how the character should change the State between walk, aim and aim walking. Like this:

Then I took a look at something more advanced, like Character Interaction in the Marketplace: https://www.unrealengine.com/marketp…er-interaction

The logic is the same. They use Anim Graph to set the skeleton position and Event Graph to set things like IK foot tracing and spine rotation when aim."

Hope it helps somebody.