Function checking then event graph

So I have created a simple inventory on my default character class, I have a few functions one of them casts a raytrace line if it hits certain objects it will store them into my inventory now as soon as the raytrace hits a item I have a sound play that works fine but I want to call a widget to add a visual notification that the player has hit the object no I can easily cast a widget and remove it but I found out you cant use a delay in a function, so I need some way of knowing that something was added to my inventory so i can display the widget then wait 3 seconds then remove it all from my event graph.

Does anyone know a way to do this i’m not to good at understanding the variables but I suppose you would do it through that some how.

I would think you want to do something like this: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/EventDispatcher/index.html

yes that’s perfect but I don’t fully understand it I have attempted but i’m not sure if i have done it correct.

Function Blueprint Screenshot - 9963fb4cce3327345bd4a9891a6f81ce - Gyazo

Event Graph Screenshot - e5da2f0b711a8cdd2eb0546554a18288 - Gyazo

That’s what I have don’t but it doesn’t work how could i fix this ?

Ah, I see. Move your BindEventToRayTrace execution to something like your begin play execution path but still hook the red line up to the ray trace event. that should fix it.

Think of binding like calling set on a normal variable. You are telling the event dispatcher what method to call when it fires. If you put it where you have it then it never gets assigned because the ray trace event never gets called because you never assigned it to the dispatcher, chicken and egg problem.

I’m taking liberties with the explanation but that’s the general notion.

if you still have issues with it shoot me an email at and we can get on teamspeak or something and I can walk you through it. This is really easy once you understand the concepts.

Thank you so much it took me a few minuets of reading you comment over and over again until it clicked but I did this.(Screenshot - 7cbd740d533e02690df5fff711d932c8 - Gyazo) and it worked fine
thank you so much!

That’s what you need! good luck on the rest of it

I also converted this to an answer so others can see how to do this. If you could accept the answer that would be greatly appreciated :slight_smile: