RealDocs

UKismetMathLibrary::MirrorVectorByNormal

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticBlueprintPure

Description

Reflects (mirrors) a vector across a surface normal. Performs the same operation as GetReflectionVector — prefer that function in new code as it has a more descriptive Blueprint display name.

Caveats & Gotchas

  • Functionally identical to GetReflectionVector. The two functions differ only in naming and Blueprint metadata. MirrorVectorByNormal predates GetReflectionVector; use GetReflectionVector in new code for clarity.
  • InNormal must be unit length. A non-unit normal scales the result incorrectly, producing a vector that is neither the true reflection nor the original direction.

Signature

static UE_INL_API FVector MirrorVectorByNormal(FVector InVect, FVector InNormal);

Parameters

Name Type Description Default
InVect FVector The vector to mirror.
InNormal FVector The normal to mirror across. Should be unit length.

Return Type

FVector

Example

Mirror a bounce direction C++
FVector Reflected = UKismetMathLibrary::MirrorVectorByNormal(
    IncomingDir.GetSafeNormal(), SurfaceNormal);
Ball->SetVelocity(Reflected * Speed);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.