Casting to a Tilemap Blueprint to obtain Tileset UserData

Apologies in advance, I’m very new to Unreal. I’m struggling to get my head around this:

I have a 2D level tilemap (top down) which is in the level as a Tilemap Blueprint.
I also have a cursor which moves from tile to tile, returning a grid reference.

I can’t figure out how I call this Blueprint so I can use the function “Get Tile” to return the text data stored in the Tileset “User Data Name”. I can do it directly from the Tilemap Blueprint on an OnTick event, but not cast from the cursor pawn when it moves over the tile and feeds the two coordinates needed to reference the tileset from the map.

In the image above, the Cast doesn’t work and warns me I don’t need to cast. Removing the cast simply returns an error. I can’t see how I reference the right Object to make this happen.

It seems like a very simple problem…

Thank you in advance,

Why can’t you just use a reference in the pawn to talk to the tilemap?

Thanks for replying.

I think that’s what I’m trying to do; refer to the Tilemap from the Pawn; but I’m not sure how I do this. (I’m aware this might be Unreal 101, but I’m obviously searching for the wrong thing). The BP code above is in the Pawn’s Event Graph.

image

I’ve tried making the Tilemap Blueprint a variable, but I’m not sure how you set the variable.
You can’t drag the Tilemap_Blueprint from the Outliner into the Event Graph of the Pawn; though you can from the Level Blueprint.

image

I’m not sure how that would help me; and copying / pasting that reference into the Pawn BP clearly won’t work. (You can’t save the project).

Appreciate your advice :slight_smile:

Ah, use GetActorOfClass to set the variable :slight_smile:

1 Like

THANKYOU.

That’s massively helpful. Problem solved.

2 Likes

Hello how are you?
Wow, I’m having the same difficulty.
Trying through an overlap event to find the “User Data Name” of the element I’m passing over.
Was this the solution you were looking for? :astonished:

Could you give some information on how you arrived at this solution?

My greetings. :slightly_smiling_face: