I’m trying to dynamically sync the rotation of a component in Blueprint A with a mesh in Blueprint B.
Both are spawned in my scene at different times.
Here’s the situation:
Blueprint A:
Only showing one at the time, but can be 40 different classes at least. It has one Scene object that rotates with meshes inside.
*I tagged the Scene Object component “module_connect”
Blueprint B:
This is a fixed blueprint class.
It needs to dynamically attach (or sync the rotation of) its mesh to the tagged component from Blueprint A.
Blueprint A and B don’t know about each other at spawn. Either could be created first.
Sometimes only A exists and sometimes only B.
Blueprint A is already fully rigged so my issue if having Blueprint B finding A.
I tried:
1- Having Blueprint B look for Blueprint A via a Tag, then getting the Component via the Tag.
However I could not attach the object or grab the rotation or anything of the sorts.
2- The idea of using Event Dispatch in Blueprint A, but I need a direct reference in Blueprint B to do the Bind, could not do it with the Get All Actors Of Tag.
That’s crazy cause till now I was working overtime for doing rebinding again and again.
Blueprint A works with Light A,
Then in a new design, I duplicate to Blueprint B that uses light B, but then you need to rebind everything.
With interfaces that should work much better I believe. I need to test it!
UPDATE: but wait, I still am looking for a reference of the controlled object.
So if I have 40 lights, wouldn’t that mean I need to still create some array of references to call the interface?
And call it 40 times. Something that dispatchers don’t care about.
Blueprint A works with Light A,
Then in a new design, I duplicate to Blueprint B that uses light B, but then you need to rebind everything.
I sense you forgot about inheritance. You declare dispatchers in the base class, every child already has it. Dispatchers work best when you spawn dynamically.
Half the time it’s about finding the reference, the other half is finding out what communication method works best in a specific scenario.
dispatchers are efficient and clean but they can also suck at times, are not suitable to all tasks. You need a reference only once and if the object does not exist, it does not matter.
interfaces are universal but they generalise, obfuscate and make a mess of things - every call is available for every entity, they return default values even when not implemented but called - super scary and hard to debug. And you need a reference every time you call.
direct comms is direct comms, you get what’s on the tin
You do not settle on one method, you use them all - where it makes sense.
I’m trying to dynamically sync the rotation of a component in Blueprint A with a mesh in Blueprint B.
Both are spawned in my scene at different times.
Probably a job for a dispacher. What spawns them, where, how?
Mostly I have two types of “blueprint to blueprint” connection needed.
I have a Design Blueprint which spawns objects and is spawned itself.
Like a Cloner.
So the Cloner needs to call actions (like Emissive Power) in each clone blueprint.
For that I use Dispatchers.
That requires binding each clone to the specific Cloner parent.
So when my design calls for a new Cloner blueprint and a new cloner type,
I duplicate my cloner+clone blueprints, but then I have to change the binding in the clones from Cloner A to Cloner B.
With 10 dispatches that’s not a smooth task to do, but that’s what I did so far.
On the other hand I could have 50 cloners and it works smoothly when called.
In this case from today, I am looking to connect a single Actor to the main Cloner, so one-on-one connection. The interface worked nicely for it,
but I am assuming if I had to do that for 30 clones, I would need 30 references?
Dispatchers have their use, of course. But they still have the very nasty aspect of having to know the class of object before binding. It would be so much nicer to bind to a neutral interface
And here, it wasn’t clear that we were trying to send the same signal to hundreds of blueprints. Then naturally, you have to use a dispatcher