How do I make it if I touch a mesh/cylinder thingy the stopwatch stops?

So i followed this tutorial: Building a Simple Stopwatch UI in Unreal Engine (with a Visual Warning) | by Shaun Codes | Medium and want to know how to stop the timer once i reach a cylinder. im really new so i dont know what everything is referencing, if someone gave me a visual of what to put, that would be great

Hello @camlovespi ,
First, we’ll make a few changes to the widget. Create a new Custom Event and add a Set Timer by Event node. Set the Time value to 0.01 and enable Looping. From the Return Value pin, select Promote to Variable to save the timer handle. Finally, connect the Event pin to your StopwatchEvent custom event. Instead of calling this from Event Tick, call it from Event Construct, since Event Construct is executed only once when the widget is created, making it much more efficient for starting the timer.
Next, create another custom event called StopTimer. Drag the timer handle variable you created earlier (named TimerStopwatch in this example) into the graph and add a Clear and Invalidate Timer by Handle node. This will stop the timer completely, preventing the stopwatch from continuing to update.

After that, open your BP_Character. Once you’ve created the widget, drag off the Return Value pin and select Promote to Variable. Connect this variable to the Add to Viewport node. Storing a reference to the widget allows you to access it later from other Blueprints and call its custom events whenever needed.

(As an optional improvement, if you want the player to press a key when reaching the object instead of triggering it automatically, you can use Actor Tags. Assign a tag to the actor in the Details panel of the Blueprint you’ll create in the next step, and make sure it matches the tag you’re checking for in your character. This ensures the interaction only occurs with actors that have the correct tag.)

Finally, create a new Blueprint using any mesh you want,in this example, a cylinder. Add a Capsule Collision component


Then create an On Component Begin Overlap event. Cast to your Character Blueprint (either the First Person or Third Person Character, depending on the template you’re using). From the As BP_Character pin, get the widget reference you stored earlier and call the StopTimer event. When the player overlaps the collision, the timer will stop immediately.

Hope it helps!