Cone Collision component creation

Hey UE community,

Does anyone have any idea how to create a cone shaped collision component? I am trying to replace my horrible cube collision (as seen in picture).

While potentially more expensive at runtime if you required a cone shaped collision specifically you could use a cone basic shape component. You would need to tick hidden in game and set the collision preset to OverlapAllDynamic. What is the purpose of the cone collision?

So what I am trying to do is have a detector for when an NPC is in view of the Player. I found out that if you edit a cone shape and give it a collision then import it into the viewport and make it invisible it works all the same, however if you have a better method I would love to hear it.

Depending on your setup your cone collision could read them as in view of the player through a wall, but you could run the detected NPC through a WasRecentlyRendered node which should prevent this. This should give you the desired result without complicating it further.

If you want something more mathematically accurate to screen you could use a box collision to detect the NPC and store/clear a reference on Begin/EndOverlap. Then use a ConvertworldLocationToScreenLocation setup (shown in picture) to find if the origin of the NPC is on screen. This is limited in that it only detects the origin but you could potentially use a GetActorBounds to get more points of reference to check against.


Hope this was helpful.