Hi, I am trying to access the vector field actor I have placed into my world. I want to run the FilteredSample function on it. The code below causes a crash with error message “Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x000000000000005c”, so I assume the cast to the UVectorFieldStatic is failing.
How can I make this work?
Thanks!
AActor* VecField = UGameplayStatics::GetActorOfClass(GetWorld(), AVectorFieldVolume::StaticClass());
UVectorFieldStatic* StaticVectorField = Cast(VecField);
FVector Sample = StaticVectorField->FilteredSample(FVector(0.0, 0.0, 0.0), FVector(0.0, 0.0, 0.0));