Passed in Actor reference invalid inside actor component on begin play

It appears that passing in an actor reference (or other variables) into the node “add component” is invalid during the begin play event, but is then recognized after 1 frame.

Steps:

  1. Create an actor.
  2. Create an actor component.
  3. Inside the actor component create an actor reference and an int variable. Mark both as editable and expose on spawn.
  4. inside the actor component, after begin play, query the actor reference and check the int value with print strings.
  5. Inside the actor, on begin play (or a delayed event), add the actor component and pass in a self reference and set the int value to any other than 0.

Hello ste1nar,

After taking a quick look at the issue described above it appears that this is working as intended. I have provided a link to another thread with more information about the order in which objects are initialized. I hope that this information helps.

Link: Add ActorComponent node not using Expose on Spawn Settings - Community & Industry Discussion - Epic Developer Community Forums

Make it a great day