Hello everyone, I was trying to get the number of spline points of a spline component in my code, and I’m constantly getting the value 1645506624 on my 20 points spline component. My code is structured as it follows :
I have a blueprint that creates a road track, using splines. So the spline component is a variable inside the blueprint. In my c++ code, I get the component using FindField and them I try to read the number of splines points of it’s reference.
this->spline = FindField<USplineComponent>(asset->GetOwner()->GetClass(), "Spline");
UE_LOG(LogTemp, Warning, TEXT("___%s___"), *this->spline->GetName());
int32 num = this->spline->GetNumSplinePoints();
UE_LOG(LogTemp, Warning, TEXT("___%s___"), *FString::FromInt(num));
The most weird thing is that GetNumSplinePoints() inside my blueprint, works just fine. So is it might be a bug?
Edited:
The solution I came up with, was store the spline number of points on an integer variable inside of my blueprint and read it’s value trough c++ code.