Search in

Sort by:

Everything Blueprint Scripting

Current Space

Question Status:

All Questions With Answer With Accepted Answer

Quick results

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

Please help! Problem Computing Movement Angle

0

I've been trying to figure this out all day and am running out of ideas. This is for a third person game using root motion animations. I have a blendspace for going from idle to walk with directional inputs ranging from -180 to 180. When the camera is behind the character, they correctly initiate walking in the right direction (forward is 0). I am struggling to think of a way to adapt the input to the correct angle for the blendspace (so that if forward is pushed but the character is facing left of the camera, the blendspace uses the animation set for 90). I have the axis inputs linked to an a2tan node to convert them to degrees, hence the character moving forward relative to themselves and not the camera. Is there a way to add or subtract the difference in degrees from the axis inputs and the camera and send the final angle to the blendspace, or another approach that would solve the problem?

I would suggest using the right vector of the character in comparison to the forward vector of the camera. Now you can determine easily which direction you must travel to inline with the camera, if I am correct in assuming that is the goal?

In any case, the best way to determine the difference between the two would be to use those vectors, or even the character forward if you like.

I've got a node set, let's say, for get forward vector from the camera and another for get right vector from the character mesh. How can I combine the two vectors and get an output of -180 to 180 (the parameters of the blendspace)? Which nodes do that?

The goal is that the output gives the angle from the character facing forward to the new direction in -180 to 180. So if the camera is looking to the character's right by 90 degrees, the axis input forward (the way I have it set currently) is 0 degrees directionally, but that it is converted to 90 to select the correct animation in the blendspace and gets the character moving in the direction the player pushed the stick.

I tried another approach entirely using rotators that worked somewhat, except it prevented the character from changing their angle more than around 130 degrees. I posted about that one too, but this one seems like a simpler approach.