Metal Detector System

I’d add a collision box/sphere to the metal detector pad that only overlaps “treasure” collisions.
On Begin Overlap get the distance to the center of the treasure. This will provide a control value to determine sound intensity. Sound intensity should simply be a play rate increase. The closer you get, the faster it peeps.

It seems i’ve got the same blueprint as you but i don’t get the sound to go faster when i approach the object and once my sphere collides with it it plays the sound and still even if i go a far from the object

Make sense but i don’t know how to do that i’m not good enough with blueprints

Oh yeah my bad now the sound stop but i don’t have the sound that goes faster when i approach the object the sound stay always the same

Well I will leave that to you and making it better fit to your needs.

Let’s recap

  1. You have a detector and a sound loop with every 0.3 seconds now. That can be a varialble float right? Some name as SoundKickTimer = 0.3
  2. On every frame you detect distance which you save as SoundVariable.. Then maybe On every frame whille calculating SoundVariable maybe you should calculate also how fast the sound kick should run.

. I would like you to experiment with it since this is how you will get better at it.

I recommed https://www.youtube.com/@MathewWadsteinTutorials and MapRangeClamped

Also there are more comments around these topic in forums and here, so try to practice and make it. Share your progress when you make it.

Okay i’ve managed to find a solution ! I’ve looked at yours and understood the Map Range Clamped or Unclamped but didn’t find the logic you were thinking and failed (i’m dumb)

So i managed to do it with the “Current Metal Distance Variable” if it’s value is greater than 180 then play the low beep and if it’s less than 150 then play the rapid beep.

I don’t know if it’s the optimal way but it’s working if you still want to explain your method i could learn !

Thank you for your time and patience and everyone else who helped !

Next step is to model a metal detector with a screen i would like to add a radar system on that screen that can display the nearest metal actor.

If you have some resources to help me in my journey it will be great ! I’ve watched many series of tutorials but don’t have yet the understanding or logic when i want to do a system by myself..

It’s not wrong! Even sometimes that kind of stepping changes needed in some applications.

However a simple way would be with the mentioned range clamped. We have already a distance here , i made some explanations on those.

So if we get the distance and map range it again for the sake of clarity.

So simply it gets the distance current → converts the max sphere range to whatever variablle you prever. I made 0.001 - 0.3 .. The closer you get the variable decreases from 0.3 to almost zero. Now we can use this with promoting to variable as LoopTime to delay our stuff.

I cleared timer on begin play instead directly call the function one time

Why we cleared timer? Can be a question, cause when timer handle is set its harder to change its handle, we have to cancel and set it again. Which we could have done but to be simpler we just made it run with a single delay node which provides us the expected resullts.

For the UI, I would suggest taking your time on designing what would be the perfect scenario for your game. After deciding that pretty much anything is possible. The thinking points around it can be started by asking the right questions and giving some decisions around it.

  • Do I want a line compass to show metals? Does it fits to my game? Why it fits or why it doesn’t?
  • Is my game first person or 3rd person? How that can effect my detection interaction? In 3rd person my character facing doesn’t necessaryly my camera facing? so how that effects players orientation to find objects?
  • Do I want a non diegetic ui llike a compass? or a diegetic compass like holding detector in hand? If so how it shoulld look like, what are the interaction design within ui and overall ux?
  • Do I want an in world indicator for metals? or not?
  • How easy or hard shoulld be to gather a metall? Is my game about this mechanic? If this is core mechanic how can I make it fun and not a boring task for player after 5000 gathers? Would my player be able to buy detectors that are better? etc.
  • Shoulld player be able to detect things behind the wallls, different weather conditions, enviromental conditions or materials effect the detection (player state). Do you have verticallity in levels that you have to detect things above you as well as under you?

These are some high level questions that are very important and are the questions that you have to find answer, you don’t have to answer those to us.

After you decide, you can show a similar video, a sketch drawing or similar things can be hellpfull for me/us to understand what you really want.

Once we have that, the rest is history…we can just strip it down to very base demonstration and make a prototype about it.

Here is a list of nice detector mechanics

Can be many things, if you decide there could be some on the youtube or in forums. If not we make it one here in this thread. Important part is to make a fair decision on what you want.

Let us know.

Well the game i’m trying to make is very similar to Dig & Deal haha i wasn’t aware of this game

I’ve made progress my detector system works and i’ve made the same system where my player has the shovel and detector in each hands.

My question is : is it possible to put a widget like a radar on a mesh ? Like i have a radar in the corner of the screen who display metal source and i’m wondering if i can put this radar on the screen of my detector

Yes ofcourse you can, especially if you have already a ui widget for radar. WidgetComponent is what you are looking for , you can set it on your detector and basically it paints widget in world space.

Oh i mixed up Widget Blueprint and Widget Component that’s why i didn’t understand why it wasn’t working my bad

I’ve add the radar on the detector but it’s just the material all the logic made on the widget blueprint that detect metal source and display on the radar doesn’t come along.

The code doesn’t seems to work if i move it to the bp_detector where i place the radar

Can you share your widget radar code, so we can take a look at it. Big screenshots or snippet drops from blueprintUE or official snippets can be helpfull too.

A video of current state would be helpfull in addition too.

Yeah this is the code i’ve made in my WB_RadarMap

I’ve made it following the tutorial from AskADev on Youtube. It works correctly but i would like to make all the system on the screen of a metal detector right now it’s just on the screen

2025-10-08 15-20-22.mkv (1.9 MB)

I understand your widget looks ok, I don’t see any big faults. + AskADev is a very good channel with many usefull tutorials done in natural way by an industry veteran.

so what I will do a very raw UI and place it on my characters hand on my sandbox project. You can use your own UMG widget.

So I transformed a bit base thirdperson template to a fake 1st person. Added a bool as IsRadarEquipped

In templates default animation, tweak into its logic to quicky add an equip animation, some bone manipulation.

I get transforms from camera like bellow from character simply

and plug them into one bone bllend and one transform bone. This will keep hands in front like a viewmodelish

If you have first person already setup you dont have to do these at all, just a hold animation would work.

Then I made a debug input in Character and switched bool.

This allowed me to do this simply. Equip/Unequip not the best but fair enough.
1

Now I will place a simple object into players hands as radar device. Created a new actor class as

Inside nothing much but just a cube for now with no collision.

Manually transform bones in the animation like a grip and make sure there is a socket in hand HandGrip_L

In my character simply spawned this radar device actor and destroy if pressed again.

I check in game positions etc and add some less ugly boxes to device actor.

Now its like this.

All I need to do is to bind a UI inside this device actor and provide necessary logic to work. The rest is improvements, gameplay improvements as sound, 3D, animation, UI, think you can polish as much as you like depending creative direction of your game.

Back to UMG widget. Made a basic UMG first named it, put a canvas and an image.

Added our newly created widget component to Radar actor and configured it briefly.


A notice over here, rendering widgets and updating them in world is something quite costly, you can use redraw time or manually redraw in future to update widget when its needed.

Since we have widget placed in world all we need to do is to display a fair enough radar ui inside.
Made background something more acceptable color and and create an overlay CoordinateContainer, that i know its size 1000. I placed some radial images under for a bit fancyness and render scale it 2x.


Made a widget for metals, just and image with render opacity animation.

If you make animation play with this node and make loops -1 it would play infinetely.

Added that widget manually and test.
2

In my Radar Actor in begin play promoted widget to a reference

Created an Tmap Actor - Radar Entry variable in Radar_WBP. Defined 2 functions which insert a widget or remove.

In our player just forwarded same actors to widgets functions is just and observer and can have its own terms.

Inside my umg on tick calculted positions for each detection actor and updated their render positions. Additionally you can assign range directly from character or from UI you can cast and gather.

3

In Addition while actors being added made additionall check for bool if device equipped so it doesn’t beeps while we don’t have device equipped.

and when we equip made sure we update overlaps for the actors we already inside range

For sound kick alllso made a check, if not equipped doesn’t beeps

After we equip made a patch to be sure that if actors around during equip we send them to UI

Results

Ofcourse it a prototype and many things can be improved. UI materials, glitches, better sound and meshes, better logic in many terms, having their own classes and driving all cosmetics from device would be better, however these should give you all the fundamentals needed.

If you want project you can join my discord and I can send it to you, however would be better if you do.

Let me know.

So I go over and make it decent.

Character Only Spawns Device

Device has Sphere and Other Cosmetics. On overlap calls the container widget.

Here is viewport of radar, I made it a bit fancy using a mesh , some materials design on it.

Radar Widget have only 2 functions that inserts and entry or removes and Device actor controls it. Once set it passes owner, widget parent and target actor.

Also contains all UI Structure

RadarEntry_WBP does everything standalone for itself. It has a pulsate animation and an event inside.

Simply Ontick calculates its distance on parent widget, Set rates for beep event and pitch, change some brush color depending on distance.

Results
This is much better way of doing it.

1 Like