Hi. I am using UE4.16.3.
I would like to ask for a 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.
I am following this tutorial (Fun with Blueprints : Spawning Dynamic Objects): - YouTube
I like a lot 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 as an object dynamicaly spawn and stored in the array.
The DynamicCow blueprint has custom event “DestroyThisToyCow” and the event is used in the Event Graph of this blueprint. -
SpawnVolume - the blueprint, in the Event Graph, 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.
The video is showing available option to choose/use “Call Function For Each->Destroy This Toy Cow”.
In the current engine version I don’t see that option.
I 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”.
In both casting situations I am getting error. I have try to solve the error but can not get around it.
The approach I would like to archive is to work directly on the objects placed in the array, not on a new copies.
Could someone please help me to solve the problem?