Download

[Feature Request] Cone-Trace For Objects

I’d like to put in a request for a cone-shaped tracing system, where somebody can specify the angle, length and world-space position and rotation of the cone, and the game will perform a trace based on that.

In my case, this is for a fire-and-forget thermal missile that wants to track for potential targets within a cone shape in front of it. I could do multiple sphere-traces but that would be considerably more expensive and time-consuming.

Cone-traces would also be incredible useful for field-of-view based object traces.

You have my sword.
Another use of this could be a cone-trace from camera to player in isometric third person games, to hide objects which obscure player character (buildings, large trees, etc.) [with cone vertex pointed at player]

BumpBumpBump

Actually, cone tracing is nothing different that tracing multiple spheres formed in cone.

Physx does not provide Cone shape, against which you can trace.

Even if it going to be default unreal function, it is sill going to use multiple spheres.

Hmm, is there any example how to implement multi sphere cast? In my case i want to hide objects that obscure player character (cast from camera to player) in Diablo-like camera view.
1da9365ea8a6847df3078912c0809c2bc9582d5f.jpeg

Multi spheres leave some space between them. And if there will be even more spheres (to cover these missed areas), how about performance cost? I guess that it must be every tick in this case.

Are you trying to perform a ‘cone sweep’ or a ‘cone overlap’? If you want to overlap a cone with the world and see what you hit, you could use an invisible static mesh component with a mesh with cone-shaped convex shape (simple collision) and then call ComponentOverlapActors or ComponentOverlapComponents.

Honestly, I’m not really sure which would be more suitable.

In this use case, the idea was that the projectile would ‘scan’ so many meters in front of it for a target based on it’s ‘FOV’, the length of the ‘cone’ would depend on things like how fast it was moving etc. The end result is that the missile would steer towards the target in it’s LOS with the highest heat-signature, relative to it’s distance from the missile.

I guess the static mesh overlap approach could work, but if there were a dozen or more doing this at the same time, could I expect major performance hits with it using mesh overlaps? Although… is there much difference anyway using a sweep trace or an overlap? I guess they’re both kind of collisions in a way.