Workarounds for Engine Hanging Bug During Line Traces

This isn’t specifically a C++ question, but might need some C++ expertise to dig into the engine code to determine a workaround.

I’m encountering an issue with the engine hanging when performing line traces at certain coordinates and would appreciate assistance in reproducing and possibly finding a workaround. I’ve submitted a bug report, but it’d be great to identify a workaround in the meantime.

Summary: Engine hangs when performing line traces at specific coordinates.

Steps to Reproduce:

  1. Create a new Open World level (“Open World” template).
  2. Update the landscape scale to 150, 150, 300.
  3. Perform a line trace (visibility channel) with these coordinates (either via C++ or blueprints):
    • Start: -98300.000, 39700.000, 15176.277
    • End: -99300.000, 38700.000, 15199.641

If you want to do it via C++, here’s some code you can put in a BeginPlay or elsewhere:

    FVector Start(-98300.000f, 39700.000f, 15176.277f);
    FVector End(-99300.000f, 38700.000f, 15199.641f);
    FHitResult HitResult;
    GetWorld()->LineTraceSingleByChannel(HitResult, Start, End, ECC_WorldStatic);

Results: The engine hangs somewhere in the line trace code.

Expected: The function should return without hanging.

Description:
I’ve noticed this issue at several locations and with multiple landscape heightmaps, including non-open-world maps. Each map requires specific start/end locations to hang.

To identify the problematic points, I created a grid of points on the map, spaced 100 or 1000 units apart and 88 units above the landscape, then ran traces between them.

Using the sculpting tool or moving the landscape can affect which locations end up hanging.

While I’m not certain if the landscape scale is directly related, I’ve only encountered the hanging when the landscape is scaled. However, I haven’t tested the non-scaled landscape extensively.

Affects Versions: 5.4.1, 5.4.2 (I haven’t tested others)

Platforms: PC (I haven’t tested others)

If anyone could attempt to reproduce this issue or provide insights into why this might be happening, I would greatly appreciate it. Any suggestions for a workaround or potential fixes would be very helpful.

Thank you!