Hello,
Can someone please help me figure this out? It should be so simple.
I have a Trigger Volume BP and when the player moves through this volume I it should Call an Event Dispatchter.
I have tried to Bind this Event Disp to another actor (GearOneBP) to start a simple timeline animation, however for some reason the GearBP does not recognize the Trigger Volume BP even though it does have a reference component.
Is this the best way to trigger this?!
Any advice is appreciated.
Thanks in advance!
(note: I am using UE5 here, however it’s not an option in the dropdown list)
You have 2 different BPs, one with a trigger volume inside, the other with the gears that should rotate when the first trigger volume overlaps something. Correct?
As I understand, you have created a variable in the Gear BP, and the variable type is your TriggerVolumeBP. And you have created a custom event dispatcher called Trigger Gears, right?
So a couple of things:
If you create a custom event dispatcher, you need to broadcast the event. Do you do that in your Trigger BP?
That blue Note on the bottom of your Cast node says that you’re casting the variable to the same type that it already is. You don’t need to do that.
Actually, you don’t even need a custom event dispatcher for trigger overlap. You can bind directly to OnComponentBeginOverlap of the trigger volume component.
All that said, I’d strongly suggest making the system the other way around. It will be a lot easier and more scalable if the trigger actor calls functions of the actors it activates, not those actors binding to events.
Look into blueprint interfaces. With them, you won’t need to know specific classes of the actors you want to activate, your target variable will be of type Actor, so you can use any actor in the level without knowing its specific class.
Hi. Thanks for the response.
Correct, I have two BPs. The TriggerVolumeBP is sending the Event Dispatcher, and I want the GearBP to start animating off it, however there are multiple instances of the GearBP (and children BPs as well) and I want all of them to trigger off this TriggerVolumeBP.
Yes, the TriggerVolumeBP is Calling the events and the GearBP is set up to Bind (as shown in the screenshot)
I know the blue Note is casting to the reference I’ve created for it, but otherwise I’m not sure what to plug into the Object Refence Wildcard here on the cast node. I’ve tried both ways, with and without the Cast node, and the GearBP seems completely unaware of the VolumeTriggerBP regardless of the refence.
I will give your recommendation a try, I hope that is propagates too all of then GearBP and children BPs.
I know about BP Interfaces, and I will give that a try also, but I thought that Interfaces were used for specific player character inputs, like on a button interaction. Guess it’s just not clear when I should use an Interface or a Event Disp.
Thanks again for your help.
Hi. Thanks for the response.
Correct, I have two BPs. The TriggerVolumeBP is sending the Event Dispatcher, and I want the GearBP to start animating off it, however there are multiple instances of the GearBP (and children BPs as well) and I want all of them to trigger off this TriggerVolumeBP.
Yes, the TriggerVolumeBP is Calling the events and the GearBP is set up to Bind (as shown in the screenshot)
I know the blue Note is casting to the reference I’ve created for it, but otherwise I’m not sure what to plug into the Object Refence Wildcard here on the cast node. I’ve tried both ways, with and without the Cast node, and the GearBP seems completely unaware of the VolumeTriggerBP regardless of the refence.
I will give your recommendation a try, I hope that is propagates too all of then GearBP and children BPs.
I know about BP Interfaces, and I will give that a try also, but I thought that Interfaces were used for specific player character inputs, like on a button interaction. Guess it’s just not clear when I should use an Interface or a Event Disp.
Thanks again for your help.
I know about BP Interfaces, and I will
give that a try also, but I thought
that Interfaces were used for specific
player character inputs, like on a
button interaction. Guess it’s just
not clear when I should use an
Interface or a Event Disp.
You’d normally use an Interface when you need unrelated classes to talk to each other. With an interface you send a message to the target actor and if that actor knows how to handle that message, it will. No casting necessary.
Registering dispatcher delegates serves a different purpose altogether. Think of them as a reaction to something else happening:
For example: above, whenever a button is clicked in the widget, a Custom Event executes in the Level Blueprint. Many widgets could bind to the very same event. And event dispatchers can be made to push data around but, unlike interfaces, they cannot return data.