UKismetMathLibrary::Conv_Int64ToInt
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintPure
Description
Narrows a 64-bit integer to a 32-bit integer by keeping the low 32 bits. Silently wraps values outside the int32 range — validate before calling if overflow is possible.
Caveats & Gotchas
- • There is no overflow check or assertion. If InInt is greater than INT32_MAX (2,147,483,647) or less than INT32_MIN, the result wraps silently. Use FMath::Clamp or an explicit range check if the 64-bit value may be out of range.
- • Blueprint's autocast uses this node when an Integer64 pin connects to an Integer input. This means Blueprint graphs can silently lose data when large 64-bit values (e.g., file sizes, Unix timestamps in milliseconds) are fed into integer math nodes.
Signature
static UE_INL_API int32 Conv_Int64ToInt(int64 InInt); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InInt | int64 | The 64-bit integer to narrow. Values outside the int32 range return the low 32 bits. | — |
Return Type
int32 Example
Safely narrow a 64-bit ID known to be in range C++
int64 AssetId64 = AssetRegistry.GetAssetId();
// Assert safe range before narrowing
check(AssetId64 >= INT32_MIN && AssetId64 <= INT32_MAX);
int32 AssetId = UKismetMathLibrary::Conv_Int64ToInt(AssetId64); Tags
Version History
Introduced in: 4.22
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?