UKismetStringLibrary::Conv_StringToVector2D
#include "Kismet/KismetStringLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Parses a string in the 'X= Y=' format back into an FVector2D, reporting whether parsing succeeded via OutIsValid.
Caveats & Gotchas
- • Uses FVector2D::InitFromString, which parses X and Y independently — a string with only one recognizable component can still report a partial success rather than failing outright.
- • OutConvertedVector2D isn't guaranteed to be reset when OutIsValid is false, so always check the flag before reading the output.
Signature
static void Conv_StringToVector2D(const FString& InString, FVector2D& OutConvertedVector2D, bool& OutIsValid) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InString | const FString& | The string to parse, expected in the 'X= Y=' format. | — |
| OutConvertedVector2D | FVector2D& | The parsed 2D vector value; only meaningful when OutIsValid is true. | — |
| OutIsValid | bool& | True if InString was successfully parsed into a 2D vector. | — |
Return Type
void Example
Parse UV coordinates from a string C++
FString UVText = TEXT("X=0.250 Y=0.750");
FVector2D UV;
bool bIsValid = false;
UKismetStringLibrary::Conv_StringToVector2D(UVText, UV, bIsValid); Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?