AActor::GetActorRightVector
#include "GameFramework/Actor.h"
Access: public
Specifiers: constUFUNCTIONBlueprintCallable
Description
Returns the unit right vector (local +Y axis) of this actor in world space, derived from the RootComponent's world rotation.
Signature
FVector GetActorRightVector() const Return Type
FVector Caveats & Gotchas
- • Returns FVector::RightVector (0,1,0) if the actor has no RootComponent.
- • In UE's coordinate system, the right vector is the +Y axis. Strafe movement should use this, not a hardcoded (0,1,0).
Example
Strafe movement C++
AddMovementInput(GetActorRightVector(), AxisValue); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?