"Calculate Direction" Node in C++

Hi, the topic basicly is the question:
what would be the c++ code i have to use in my AnimInstance to have the same functionality as the “Calculate Direction” node? Getting the speed was really no issue…direction seems a bit more complicated.
Do i have to use my input axis values for that?
My character has two movement modes. One is simple by facing the direction he is moving.
Second one he is moving in the direction as by input but facing towards a cursor for aiming with a gun.
Thank you in advance

After some googeling (which i could have done better before asking here) i found the solution.
So for anybody who wants to calculate speed and direction in C++ instead using the AnimBlueprint, here is my code.

.h file:

350600-anim-h.png

.cpp file:

AnimBP:

2 Likes

Hi, may you share your solution again?

Please!

You mean the code I used?

1 Like

UKismetAnimationLibrary::CalculateDirection();

1 Like