Unreal Engine 5 · Blueprint → C++
Rotate Vector in Unreal Engine 5 C++UE Docs
The Rotate Vector Blueprint node maps to Rotation.RotateVector(V) in Unreal Engine 5 C++, and UnrotateVector(V) performs the inverse rotation.
Blueprint node & C++ equivalent
FVector Rotated = Rotation.RotateVector(V);
FVector Unrotated = Rotation.UnrotateVector(V);What does the Rotate Vector node do?
Rotate Vector takes a direction or offset and rotates it by an FRotator, transforming it from local space into the space defined by that rotation. The vector's length is preserved; only its direction changes.
This is how you convert a local offset, such as a muzzle position relative to a weapon, into world space.
The C++ equivalent
Call Rotation.RotateVector(V) to apply the rotation, returning the rotated FVector. To reverse the operation, call Rotation.UnrotateVector(V), which rotates by the inverse and maps a world-space vector back into local space.
Both methods live on FRotator and require no additional includes in typical gameplay code.
When to use it in C++
Use RotateVector to place local offsets in the world or to align a velocity with an actor's facing. Use UnrotateVector when you need to express an incoming world direction relative to an object, for example computing strafe input relative to the camera.
Frequently asked questions
How do you rotate a vector by a rotator in UE5 C++?+
Call Rotation.RotateVector(V) on the FRotator. It returns the vector rotated into the rotation's space while keeping its length.
What is the difference between RotateVector and UnrotateVector?+
RotateVector applies the rotation, mapping local to world space. UnrotateVector applies the inverse rotation, mapping world back to local space.