{ }Blueprint → C++

Unreal Engine 5 · Blueprint → C++

Square Root in Unreal Engine 5 C++UE Docs

The Square Root Blueprint node maps to FMath::Sqrt(Value) in Unreal Engine 5 C++, which returns the square root of a non-negative float.

Blueprint node & C++ equivalent

C++
float Root = FMath::Sqrt(Value);

What does the Square Root node do?

Square Root returns the non-negative root of its input, the value that multiplied by itself gives the original number. It appears constantly in distance, magnitude, and falloff calculations.

Passing a negative number is undefined for real square roots and should be guarded against.

The C++ equivalent

Call FMath::Sqrt(Value), which takes a float and returns its square root as a float. It wraps the platform's optimized square-root instruction.

When you only need the reciprocal of a square root, for example to normalize a vector, FMath::InvSqrt(Value) is faster than computing 1.0f / FMath::Sqrt(Value).

When to use it in C++

Use FMath::Sqrt to convert a squared length back into a true distance. For pure comparisons, however, prefer comparing squared distances with FVector::DistSquared to avoid the square root entirely, since it is cheaper and the ordering is identical.

Frequently asked questions

What is the C++ equivalent of the Square Root node in UE5?+

Use FMath::Sqrt(Value), which returns the square root of a non-negative float.

Is there a faster alternative to FMath::Sqrt?+

Yes. FMath::InvSqrt computes 1/sqrt directly and is faster when you need the inverse, such as for vector normalization.

Related Math nodes

View all Math nodes →