• News

• Industries

• Learning & Support

• Community

• Marketplace

# Custom Overlap Collision Shapes

I am thinking about scripting a “welcome to Place__” whenever you enter a location. For example, if I have a place called Town of the elders and when you enter the area it displays it on the screen using a widget in the HUD. I know how to do this with trigger volumes and stuff, but How do you do this if the location has a weird shape like an oval or something? if I just create a box, it will display this if I possibly step into from a nearby road or path that doesn’t quite fit or make sense as being “in” that area?

I could possible setup actors with collisions on entry points, but then I would have it pop up for every overlap or hit. A giant collision box on an actor could work, but then its a square and might trigger over and over if i am on the edge of said collision box/sphere/capsule…

So How do i set something up like this? Any ideas on how to make a shape or something to gauge when the player actually steps into that location?

Hi man,

A similar question was asked some times ago, i am pretty sure that someone was able to make a “custom shape” but i dont know how.

I think that if you have something like a city, is ok having the Welcome from a certain distance of the city,
You dont have to Welcome thee player only when they step on the gate, if you have a big city with multiple gates and fields,
you can surely just place a sphere trigget box and get the overall shape of the city.

Beside that, you can fix the “trigger over and over” making a double check,
with 2 Trigger-Sphere , one bigger one smaller, and adding a variable to know where the player is.
So when you enter the Inner sphere you check if the City he is entering is the same is already is, If is not, Say Welcome,
When you leave the bigger sphere, you say : you are leaving the city,

This way you can avoid continue popup of welcome and leaving.
Because the player Enter and Leave from 2 different “Distance-Locations”

There are lots of ways, but here’s three common ones: 1. Use a Get-Distance node between PlayerBP and a level center point run off a Timer. Set the distance by choosing an approx center point to the actual center (from a birds eye view). This works even better when you use in-world widgets to display the pop-up, as it gets placed above the center area. 2. You can also attach a collision box to the front of the player (or their camera). When they bump into level geometry you then get a Tag property from the meshes hit and show the appropriate location popup. 3. Do a line trace from the player (or their camera) to level geometry and get the Tag again.

All three options are more flexible than using trigger / overlap volumes. BTW1: If you group meshes / actors into location folders in World Outliner you can then set a Tag for the entire group in one go… BTW2: You can also use the WIC (Widget Interaction Component). Its more advanced to setup, but it offers a lot more options as well… BTW3: Overall, there are hybrid ways to tackle this too. For example you can query an Overlap-Sphere from within the PlayerBP and then grab all the nearby actors. By counting up the Actors + Tags, you can deduce which area of the map you’re more likely-in or leaning more towards (rural vs suburbs vs downtown etc)…

Thanks guys! I will investigate these options and see which implementation offers me the best outcome! Much Appreciated!

@MindfieldsTech

You can use the geometry tools (pen) to create a custom shape. Once created convert it to a static mesh, then set the collision to complex.

Next create a BP and add the mesh. Set the collision to “generate overlap events” and Overlap Pawn … ignore all for the rest.

With the SM selected in the BP scroll details to Events and click “On begin Overlap”. Configure your overlap event logic.

Under Render -> “Hidden in Game” true.

Dude, You’re amazing! I think that is it!

Glad it worked for you. I use this approach for a lot of things. Audio volumes, blocking volumes, light propagation, kill zones etc.

Yea I am def going to try it out for Audio too. I was going crazy with areas and audio as well Much appreciated!

For production you should export the static mesh FBX files and clean them up (optimize) in proper 3D software. Blender, Maya etc.

Good Point. That will help reduce polys and such. Thanks!

@Rev0verDrive

If you have some time dude, any chance you could say more about that: (if possible using latest version of Blender)…
Why? Because lots of devs primarily do kitbash (not original 3D authoring) and so rarely use Blender / Maya if ever.
i.e. Is there a simple tool in Blender to clean up a mesh or reduce polys on a static mesh created from 3D-Text etc?