Spawning actor on client and getting a reference to it

Are you using a “Switch has authority” on the spawning event?.

What i tried is:

Custom event “Run on server” >>Spawn Actor >> Set actor reference.

When i do this and Play the game with “Run dedicated server” option, the actor will spawn and i will have a reference, but all variables seems to be wrong, maybe null. My UI should be displaying things like my current life, but this is failling even when those variables are replicated too.

But if instead of this i just do a Hit and get all actors close to me, then set the reference , the variables DO show in the UI this time.

I have this event on the player character blueprint.

Note: I also added a print string + actor display name. if i dont’ use switch has authority it seems like it is spawning 2 actors ( one might be the server version, i don’t really know) but the client only sees one. With the switch has authority only spawns one. In any case, the client seems to not be able to read the reference variables and display them in the UI.

edit|delete| more ▼
Newest
answered 6 secs ago
D2liriuM gravatar image
D2liriuM
1 ● 1 ● 1