x

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"

Please help! Problem Computing Movement Angle

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?alt text

Product Version: UE 4.13
Tags:
more ▼

asked Nov 07 '16 at 06:45 AM in Blueprint Scripting

avatar image

entropyandvodka
11 1 3

avatar image learningOver Nov 07 '16 at 11:43 AM

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.

avatar image entropyandvodka Nov 08 '16 at 12:47 AM

Can you be a little more specific?

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.

avatar image entropyandvodka Nov 08 '16 at 01:43 AM

Never mind, figured out the delta rotation. Still running into that same turning problem though. Thanks!

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

0 answers: sort voted first
Be the first one to answer this question
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