I am trying to make a sonar for an underwater exploration game.

I am trying to make a sonar for an underwater exploration game. I want it to be used to see the location of a sea monster and how close it is to my submarine. Similar to this picture from the move “The Sphere” but I want it to be a full circle instead of that. Any help is really appreciated.

it depends on if you want the functionality to be based on How a Sonar physically works, or how a Real World Sonar is physically visualized.

how a Real World Sonar Physically works is it sends out effectively a sphere shaped sound pulse that when it hits a non concave surface is reflected back at the source.

how they a physically visualized is through a radial sweep across a 2D plane

to accomplish the Real World Function would be to do something like gradually increasing SphereTracesMultiForObjects. On the first sphere you clear like an array, then on each graduation you only ever add to the array, and when you hit the final size you would start again.

to simulate how s Sonar is visualized in the Real World could be accomplished by having a SceneComponent attached to the Pawn-Root and changing its relative orientation then on a timer (ie Tick()) send out a line trace from the Pawns center in the direction of the SceneComponent Forward (the issue with this is that it will only apply to the 2D plane, so if you are going full 3D it wouldn’t be exact)

some combination of these 2 might be necessary as there could be an edge case where the Sphere method would give you a result of an object that is behind another object (requiring a line trace single to see if it should be displayed) while the nature of LineTrace means it doesn’t account for the full 180-degree arc.