Surface snapping causes erratic changes in scale to StaticMeshActors that have children of the same type.
The user also has provided a potential solution to this bug (Please see the code below. Note the + is for code additions, while the - is for code deletions)
+ +static void GetAttachedActorsRecursive(const AActor* InActor, TArray<AActor*>& OutActors) +{ + TArray<AActor*> AttachedActors; + InActor->GetAttachedActors(AttachedActors); + for (AActor* AttachedActor : AttachedActors) + { + GetAttachedActorsRecursive(AttachedActor, OutActors); + } + OutActors.Append(OutActors); +}; + void FLevelEditorViewportClient::ProjectActorsIntoWorld(const TArray<AActor*>& Actors, FViewport* InViewport, const FVector& Drag, const FRotator& Rot) { // Compile an array of selected actors @@ -2317,6 +2329,11 @@ if (bIsOnScreen) { + + TArray<AActor*> IgnoreActors; + IgnoreActors.Add(Actor); + GetAttachedActorsRecursive(Actor, IgnoreActors); + // Determine how we're going to attempt to project the object onto the world if (CurrentAxis == EAxisList::XY || CurrentAxis == EAxisList::XZ || CurrentAxis == EAxisList::YZ) { @@ -2335,11 +2352,11 @@ TrimLineToFrustum(Frustum, RayStart, RayEnd); - TraceResult = FActorPositioning::TraceWorldForPosition(*GetWorld(), *SceneView, RayStart, RayEnd, &Actors); + TraceResult = FActorPositioning::TraceWorldForPosition(*GetWorld(), *SceneView, RayStart, RayEnd, &IgnoreActors); } else { - TraceResult = FActorPositioning::TraceWorldForPosition(Cursor, *SceneView, &Actors); + TraceResult = FActorPositioning::TraceWorldForPosition(Cursor, *SceneView, &IgnoreActors); } } }
Tested in 4.20.3 (CL - 4369336), 4.21.2 (CL - 4753647), 4.22.1 (CL - 6063286), 4.23 (CL - 6543257)
Expected:The parent cube and its children cubes would snap to the nearest surface
Result: All of the cubes rapidly oscillate in scale
i have this problem UE4CC-Windows-58DC12AF4B97F057BD108FBFF569B2E9_0000
UE-74991 also affects Valve Index
Undefined sysmbol: typeinfo for AActor when cross-compile linux dedicated server on windows
Delay nodes occasionally don't fire the "Completed" output in a nativized build
I am not able to find world outliner how to enable it?
How can i modify the param name in EQS node
I can't open my map from the editor.
When I open UE4 4.24.3 it appears that. Does anyone know how to solve?
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-74804 in the post.