UKismetMathLibrary::Conv_ByteToDouble
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Widens a uint8 byte to a double-precision float. Tagged BlueprintAutocast so Blueprint will insert this node automatically when a Byte pin is connected to a Float/Double input.
Caveats & Gotchas
- • In UE 5.0+, Blueprint's native float type became double-precision. This function targets the double (was float pre-5.0) overload. Projects migrated from 4.x may have stale Blueprint nodes referencing the old float variant — rebuild the node if you see type mismatch warnings.
- • The conversion is lossless for all 256 uint8 values, but the result pin in Blueprint shows as "Float" regardless of the internal double precision. This can mislead designers into thinking precision was lost when it was not.
Signature
static UE_INL_API double Conv_ByteToDouble(uint8 InByte); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InByte | uint8 | The byte value (0–255) to convert. | — |
Return Type
double Example
Normalize a health byte to 0-1 range C++
uint8 HealthByte = GetHealthAsByte();
double Normalized = UKismetMathLibrary::Conv_ByteToDouble(HealthByte) / 255.0;
HealthBar->SetPercent(static_cast<float>(Normalized)); Tags
Version History
Introduced in: 5.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?