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"

What Is A Forward/Up/Etc Vector?

I know this sounds stupid, and it's probably self explanatory, but I just want to confirm I'm right in my insinuations on what these mean. I can't find anything anywhere about directional vectors. Where exactly is a "forward vector" on a component or actor?


Product Version: Not Selected
more ▼

asked Jun 30 '14 at 11:19 PM in Using UE4

avatar image

49 1 3 10

avatar image ymars STAFF Jul 07 '16 at 04:59 AM
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hi there!

Forward Vector

The direction that is straight in front of the actor, based on its root component.

Right Vector

Directly to the right of the facing direction of the root component of the actor

Up Vector

I think you got this one

So these directions are relative to the rotation of the Actor's root component, which makes them every useful for things like dodging mechanics!


more ▼

answered Jun 30 '14 at 11:25 PM

avatar image

10.6k 446 346 1088

avatar image AllenGingrich Jun 30 '14 at 11:34 PM

Thanks! Where exactly is the point on these vectors, just to clarify? Would the forward vector be straight in front, touching the root component, 50% the height and 50% the width?


avatar image jwatte Feb 25 '17 at 12:42 AM

This is a late comment, but for others who find this answer: The vectors are not "located" anywhere, they are relative. They always have magnitude one (they are normalized.) Thus, for a new actor that hasn't moved or turned, "forward" will be +X, and "up" will be +Z. As the actor turns around as part of movement, "forward" will point in different directions. The "forward" and "up" and "right" vectors are much like "compass headings" not like "positions."

avatar image oOo.DanBO.oOo Sep 20 '14 at 05:50 PM

i was looking for the RightVector but it is not included..

     /** A zero vector (0,0,0) */
     static CORE_API const FVector ZeroVector;
     /** World up vector (0,0,1) */
     static CORE_API const FVector UpVector;
     /** Local Unreal forward vector (1,0,0) */
     static CORE_API const FVector ForwardVector;

do you know the reason why its not there? i just want to use it for readability reasons :)

avatar image Dyronix Feb 06 '15 at 04:11 PM

Because the crossproduct of Up and Forward vector is equal to the right vector. FVector::CrossProduct(FVector::UpVector, FVector::ForwardVector);

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

Just to add a bit to Ramas answer.

You could use these vectors relative to the Actor or relative to a particular Component of the Actor.

As Rama said, the functions:

GetActorUpVector (LINK), GetActorForwardVector (LINK), GetActorRightVector (LINK) get the Actors root component Z (up), X (forward), and Y (right) vectors and convert that to a World Space vector.

Now, GetUpVector (LINK), GetForwardVector (LINK), GetRightVector (LINK) get the the component from which you call this methods Z (up), X (forward), and Y (right) local vectors and convert that to a World Space vector.

An example of this is if the Actor with a Capsule Component as the root component is facing a direction and you have a Camera Component attached to your Capsule Component as a child. If you look around with the Camera (locally rotating the Camera Component relative to your root Capsule Component rotation) the GetActorForwardVector (`Actor` root component) and the GetForwardVector of the Camera Component will be different. Keep in mind that these are both converted to World Space and Normalized (magnitude = 1.0). This allows you to get directional information in World Space for actors and individual components attached to that actor easily.

Edit: Also, you can negate the vectors to get the opposite. Like, -Up (-Z) vector will give you the down vector, -Forward (-X) vector will give you Backward vector.

I hope this helps clarify a bit. =)

more ▼

answered Jul 01 '14 at 01:25 AM

avatar image

1.6k 61 45 237

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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