Inside a BP I need to rest multiple items. On event begin play there is a sequencer with multiple lines going to reset each item with wires everywhere.
To clean this up is there something that can be used that is opposite of a custom event? The custom event you can have an event and then have a hundred calls to that event, I want the opposite.
Also another option besides what ClockworkOcean had said about Event Dispatchers is just make multiple custom events. Let’s say you have 5 resets then make 5 custom events, it is quick and easy.
Thank you clock work ocean, the problem with Event Dispatchers is you have to have a custom event for each binding so it really does not help, if you were using it for notification in multiple blueprints it works good but not inside one blueprint.
I wish UE had a node like a custom event but opposite.
Place all your items in a set or an array. On this step just go through the array and Reset them.
Now if your reset functions have different names in each class - this is a problem you must solve sooner rather than later.
Make sure that each class has a proper Reset function maybe even demand it with an interface.
Hi dZh0 , Thank you for the reply, in the screenshot you can see all the wires, I am just trying to get rid of them to make it look cleaner. Some blueprints have a lot more. I wonder if you could some how make a macro do this?
Can you send me a screenshot of what you are talking about, are you saying to use and array with Event Dispatchers?
The problem you have is that there are a bunch of things that are doing different things in the same blueprint. (BTW in what object does this this blueprint reside in?) I would suggest you move each collider in a separate objects with common interface probably. You’ll still have to reset them all though.
The other thing is that you are tracking strange stated - don’t focus so much on implementation. Figure out your logic and act on it.
Here is an example of an actor with a bunch of colliders and the box can be interacted with only once since its collision is disabled afterwards:
I never thought about disabling the collision afterwards, that is a great idea, I will play around with that, it could do away with the majority of the DO Once nodes.
I personally like as much stuff as possible in one BP Event Graph, that keeps me from jumping between so many windows and tabs.
I am a strong proponent of the “One Responsibility Rule” per object but it’s subject of debate so do your project the way you feel it’s best.
Lean on the base functionalities provided by the engine - components and composition, disabling, cloning and transferring components, ticks and tick rates.