RealDocs

UKismetMathLibrary::SelectRotator

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

Description

Returns A if bPickA is true, otherwise returns B. Useful in Blueprint graphs for conditionally choosing between two rotations without a branch node.

Caveats & Gotchas

  • No interpolation or slerp is performed — the result is an exact copy of whichever rotator is selected, so values are not normalised or clamped.
  • Both rotators are constructed and passed before selection; avoid computing expensive rotations inline if only one is ever used, as there is no short-circuit.

Signature

static UE_INL_API FRotator SelectRotator(FRotator A, FRotator B, bool bPickA)

Parameters

Name Type Description Default
A FRotator Returned when bPickA is true.
B FRotator Returned when bPickA is false.
bPickA bool Selector: true returns A, false returns B.

Return Type

FRotator

Example

Pick aim or idle rotation C++
FRotator Facing = UKismetMathLibrary::SelectRotator(AimRotation, IdleRotation, bIsAiming);

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.