It sounds like you have a certain problem ( which we don’t know ), and have decided this is the solution, whereas, it may not be a good way forward.
Are you trying to spawn actors at impact points without overlapping other actors perhaps?
The general case of finding the edge of a mesh is not straightforward.
If you are trying to spawn non-overlapping actors, it might be easier to have special versions of them with the pivot point at the edge of the mesh, the there’s no problem.
I have a pawn that I draw some line traces around in a circle on the X axis. I then spawn an actor which has no collision at the end of each line trace using a combination of the ImpactPoints and TraceEnds. This means the spwaned actor clips into other objects.
How can I move all the spawned actors along the line trace’s normal so that the edge of the actor is at the Trace Ends or Impact Points? I have an image I hope shows the problem and desired result better than I can explain many thanks.
The actors are all spawned at BeginPlay, then their location is changed every tick relative to the pawn in the middle, kind of like a force field. When there is an impact a force is sent along the normal to move the pawn in the opposite direction of the impact.
I have no concern for the spawned actors overlapping each other, only other objects in the level.
Or use Trace End instead of Location if you do not care about obstacles in the way.
Alternatively, use a sphere trace and feed it required radius, you’ll still need a bit math - not sure if this is any good here; can the trace squeeze through a narrow opening? If you do not know the size upfront but know the class of the actor, you can get bounds from the class defaults (or a perhaps the actor knows its size and it’s a matter of getting a variable?).
There simply is not enough details to account for all possibilities. The above may be a solution but may not be the best solution.
If the actor has an irregular shape (ovoid, egg, banana, umbrella) and you cannot use set radius, you could Sweep. Sweeping stops short of destination. Again, Implementation would depend on the detail.
The algorithm you gave worked exactly how I wanted, many thanks but also thanks for highlighting Sphere Trace as it may actually be a better solution for my game