Hi. I am using UE4.16.3.
I would like to ask for help how to access my custom event of dynamic objects placed in an array.
I have spent quite a lot of time to get it work but I can not find the right solution.
The approach I would like to achieve is to work directly on the objects placed in the array, not on a new copies.
I am following this tutorial (Fun with Blueprints : Spawning Dynamic Objects): https://www.youtube.com/watch?v=9-7SmkasS_A
I like a lot the solution showed there but it was created in older version of the UE.
Everything is working for me to the moment when I try to access my custom event of dynamic object stored in the array. (Video time: 25m19’).
Generally there are used two main blueprints for it:
DynamicCow - used a an object dynamicaly spawn and stored in the array.
The DynamicCow blueprint has custom event “DestroyThisTowCow” and the event is used in the Event Graph of this blueprint.
SpawnVolume - the blueprint, in the “EventGraph”, spawns the “DynamicCow” objects, stores them in the array and
at the end iterates by all “DynamicCow” objects stored in the array calling on each “DestroyThisToyCow” custom event.
On the video is shown available to choose/use option “Call Function For Each->Destroy This Toy Cow”.
In the current engine version I don’t see that option.
I have try to use “Array->ForEachLoop” but it doesn’t give me the access to my custom event created for “Dynamic Cow”.
I try to cast the object returned by “ForEachLoop”.
One approach - casting into “Class”, the second into “Reference” (Like on the screenshots).
In my case the “DynamicCow” blueprint I have named “MyDynamicObject”
and custom event “DynamicCow->Destroy This Toy Cow” I have named “MyDynamicObject->Destroy This Dynamic Object”.
For both “casting situations” I am getting error. I have try to solve the error but can not get around it.
Could someone please help me to solve the problem?