Blueprint reference from spawned blueprint to blueprint in level is always empty, where am I going wrong?

I’m trying to get a spawned actor blueprint to send an event to an actor blueprint (called ShipTileBP) that is in the level. I have tried event dispatchers, custom events and interfaces, yet I always run into the same problem; I make a variable to act as a reference to the ShipTileBP blueprint by selecting the Ship blueprint under the reference section in the ‘Variable Type’ drop-down box. I’m then using this variable as the target for the message, to get the event to fire in the ShipTileBP blueprint, yet when I’m debugging it always shows the reference as none. I’ve looked through the comms documentation at length but can’t find anything to suggest where I’m going wrong.

Hi

My guess would be your casting is not working. Do you have and script you could show us?

Ok, Firstly, sorry for not getting back to you sooner and thanks for the reply, I’ve been away working on other projects for a while and haven’t had chance to check in.

So in my original post I had attempted to set a variable as a cast target by finding the blueprint I wanted by looking it up in the drop-down list of variables in the blueprint variable settings menu (shown below). However I now think that that method does not link to a single instance of a blueprint, meaning that you can’t cast with it. This confused the life out of me because I’m sure I managed to make it work with the old _C method, which was removed for some reason.

I’m now spawning my objects from a single blueprint placed in the level that controls all the spawning and events in the game. In this blueprint I’ve simply spawned the blueprint , then cast to it using the Return Value pin on the spawn node as the target. This seems to work fine, I’ve been able to set a reference to self and passed that to an actor variable in the spawned blueprint. I can then use this later to allow the spawned to target the first blueprint. Hopefully the screenshot below makes this clearer. I don’t know if there’s a cleaner way of doing this, but it seems to work.