RealDocs

UKismetMathLibrary::GetPI

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

Description

Returns the mathematical constant π (~3.14159). Primarily useful in Blueprint; in C++ prefer the UE_PI macro or PI directly.

Caveats & Gotchas

  • In C++ code UE_PI (or the standard M_PI where available) is zero-cost at compile time; using this function in tight C++ loops adds unnecessary function call overhead.
  • The return type is double — if you assign to a float, the value is narrowed to float precision (~7 significant digits), which is sufficient for most gameplay math but can accumulate error in long-running simulations.

Signature

static UE_INL_API double GetPI();

Return Type

double

Example

Compute circumference from radius in Blueprint-called C++ C++
double Radius = 100.0;
double Circumference = 2.0 * UKismetMathLibrary::GetPI() * Radius;

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.