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"

[Closed] Actor Forward vector not working properly

I'm creating a 2d fighting game and I'm stuck on why I'm getting different values from different blueprints for my actor's forward vector. When I print my actor's forward vector from the actual character blueprint event graph I get what is expected, which is a positive forward vector in the x (+1.0) when facing my opponent on the left side and negative forward vector when turning to face my opponent from the right side (-1.0). However, when trying to grab that same forward vector and print the results from my animation blueprint which is attached to my character blueprint, I only ever get a positive forward vector value in the x (+1.0) and never a negative value when I turn to face my opponent from behind him (on the right side of him). I don't know why I'm getting two different results for my forward vector every frame. Here is my Animation blueprint code:

alt text

Here is my 2d game with the output of the string shown on the left of the screen every frame. If you can't read it is says x is +1.0 which is correct as my character is facing forward in the positive x direction:

alt text

However, when I'm on the other side facing in the negative x direction, the animation blueprint still outputs a +1.0 forward vector which is not correct:

alt text

Product Version: UE 4.12
Tags:
more ▼

asked Aug 19 '16 at 06:25 AM in Blueprint Scripting

avatar image

Boagz
50 14 21 28

avatar image ScottSpadea Aug 19 '16 at 07:26 AM

i tried getting actor forward vector in an anim blueprint, but i don't get the problem you are seeing.

maybe you are rotating the skeletal mesh instead of the actor? because get ActorForwardVector only cares about the root component capsule's rotation, and it won't change if you rotate its children.

avatar image Boagz Aug 19 '16 at 01:56 PM

Well here's how I'm rotating my character in the Character blueprint:

alt text

This is in a LockOn function which gets called when I hit the lock on input button (this is how I get my character to face the opponent). Again though, when I print the actor forward vector from here, I get the correct forward vector for the actor. Could my problem have something to do with the mesh itself? It's one of adobe's mixamo mesh and animations.

UPDATE: This is not the problem as I have tried multiple different meshes and the same problem persists.

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

The question has been closed Aug 19 '16 at 03:42 PM by Adam Davis for the following reason:

Duplicate Question


1 answer: sort voted first

Hi Boagz,

I see you have a post on this subject already here:

https://answers.unrealengine.com/questions/472557/repost-actor-forward-vector-not-working-properly.html

Please continue the conversation there. I am closing this thread as a duplicate.

more ▼

answered Aug 19 '16 at 03:41 PM

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

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question