FSuggestProjectileVelocityParameters was introduced in 5.4 and has a FCollisionResponseParams member that's initialized as a mutable reference to FCollisionResponseParams::DefaultResponseParam.
struct FSuggestProjectileVelocityParameters
{
...
public:
FCollisionResponseParams& ResponseParam = FCollisionResponseParams::DefaultResponseParam;
}
This is a problem because game code that declares a FSuggestProjectileVelocityParameters can modify FSuggestProjectileVelocityParameters. This makes it very easy for game code to unintentionally modify the global static DefaultResponseParam. See repro steps.
Run the following code on BeginPlay:
void ACollisionResponseRepro::BeginPlay() { Super::BeginPlay(); UE_LOG(LogTemp, Warning, TEXT("Default collision response to WorldStatic before: %d"), int32(FCollisionResponseParams::DefaultResponseParam.CollisionResponse.GetResponse(ECC_WorldStatic))); const FVector StartLoc; const FVector EndLoc; UGameplayStatics::FSuggestProjectileVelocityParameters VelParams(GetWorld(), StartLoc, EndLoc, 1000.0f); VelParams.ResponseParam.CollisionResponse.SetResponse(ECC_WorldStatic, ECollisionResponse::ECR_Ignore); UE_LOG(LogTemp, Warning, TEXT("Default collision response to WorldStatic after: %d"), int32(FCollisionResponseParams::DefaultResponseParam.CollisionResponse.GetResponse(ECC_WorldStatic))); }
Observe: the output of DefaultResponseParam.CollisionResponse.GetResponse() changes before and after the unrelated user code: 2 -> 0.
Expected: No change to DefaultResponseParam.CollisionResponse.GetResponse(): 2 -> 2.
I am not able to find world outliner how to enable it?
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
How can i modify the param name in EQS node
When I open UE4 4.24.3 it appears that. Does anyone know how to solve?
What properties of the progress bar can be used for drag and drop highlighting?
What property of the Slider is the image used when dragging?
Delay nodes occasionally don't fire the "Completed" output in a nativized build
What method is used to fill polygonal regions when drawing spline mesh at run time?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-224510 in the post.
1 |
Component | UE - Gameplay |
---|---|
Affects Versions | 5.4 |
Target Fix | 5.6 |
Created | Sep 17, 2024 |
---|---|
Resolved | Sep 17, 2024 |
Updated | Oct 1, 2024 |