Reading variables of spawned actor and passing those to other BPs with EventDispatcher not running

Hi there,

can someone help me out with reading variables from a spawned actor and making them available to a few BPs?

current setup:
I am spawning actors on my map.
Via raycast on one of those actors, an Interface is called which runs a function on the selected actor reading its variables and passing these via custom event to another BP.
Player controller raycast on actor > Actor starts function and calls custom event > 3rd BP starts event with variables

what I am trying to achieve:
pass the variables via event dispatcher or another solution to many BPs.
I can’t get it running for a few days now and I don’t know what I doing wrong. Is it even possible to bind events to spawned actor classes? I don’t know what to put into the target at “bind event”.

/edit
added screens.

  1. InterfaceCall in BP1
  2. Function Return and EventDispatcher Call in BP2
  3. bind event in bp3

the last one is with a cast (where I don’t know what to put in Object). Tried it without as well.

138771-1.png

Create your dispatcher in gamestate, then in you bp classes use GetGameState() → BindTo(). Then call this dispatcher wherever you want.

Thanks for taking your time to reply.
It is running now after I did what you said. After ReturnBoolean an CustomEvent is called via CastToGameState.

I am a bit confused now as I thought any BP could do what GameState does in this case. Guess I need to read it up again.

For others with this issue:
You can’t link GetGameState() directly into BindTo(). It needs a CastToGamestate.

This is because you are using other gamestate class, not official. You have to cast to the custom gamestate you are using.

absolutely right.
Is there a way to handle it with the default GameState?

You can edit default one, but I don’t think you want to do this.)