UKismetMathLibrary::Vector_GetSignVector
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Returns a vector where each component is +1 if the corresponding component of A is non-negative, or -1 if it is negative. Useful for sign-preserving operations like mirroring or quadrant detection.
Caveats & Gotchas
- • Zero is treated as positive: a component of exactly 0.0 returns +1, not 0. Do not rely on this to detect zero components.
- • The result is always (±1, ±1, ±1), so it is not a normalised direction vector in the general sense — it points diagonally unless only one component is non-zero.
- • Equivalent to FVector::GetSignVector() on an FVector instance.
Signature
static UE_INL_API FVector Vector_GetSignVector(FVector A); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| A | FVector | The input vector. | — |
Return Type
FVector Example
Mirror a reflection offset to match the incoming direction C++
FVector IncomingDir = HitResult.ImpactNormal;
FVector Signs = UKismetMathLibrary::Vector_GetSignVector(IncomingDir);
// Each axis of Signs tells us whether we need to mirror (+1) or keep (-1) See Also
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?