Get Index Spawned Tiled Actors

I am very beginner. Started a month ago.

So far trying my first game.

I have an Hex Tile Generator

Thanks to UE4 Tutorial: Hex Grid - YouTube

There are two functions getting called at the end.

TouchBegin and TouchEnd

Things I would like to do

  1. I want to get index of object from BeginTouch,

  2. store it in actor variable.

  3. Then feed it to touchEnd function

  4. Do some mathematics in there to interact only with adjacent heagonal tiles at TouchEnd by checking it by branch as shown in below image

My touchEnd function look like this for Now

I am quite confident that I will be able to figure out the math.

But I am not sure how can I get the index of spawned actor from SpwanActor Function

Or it will be very helpful if I able to store the index in array of some kind.

You do have the reference here, of course


You can easily put them in an array.

The problem comes when you try to do something with ‘adjacent’ tiles. Obviously, we know what that is, but I suspect you will have trouble coding it…

how to put them array. I know that return node is there. But it splits out all the actors at once if I print actor’s names

As you can see in Image, If I tried to attach it to array, then it takes whole things as 0 index. I just want to able to get the spawned meshes by their index and store them in array on EventBeginPlay. Rest seem straightforward to me for now.

It was very easy. The video tutorial had all the things already. I guess I just got excited by generating Hex Tiles first time

This is how I stored those meshes in array

And Now they can be called easily by an event from the event graph.

I think I will be able to figure out rest of the solution on my own now.

If anyone needs it ask in the comment.
I will upload it once I finish it.