Power Up Replication

Hey guys! I am having a hard time getting the visuals from the server decided power up to be displayed on the client. The correct power up effects seem to be replicated just fine. When I pick up the power up on the client I get the correct effect displayed.

On begin play I run ServerSpawnInitialPU(Run On Server, Reliable) then SpawnInitialPU(Multicast, Reliable) Both client and server print “It’s Happening!” The server displays the power ups as it should, and the client can pick up the power ups the server sees, they just aren’t visible to the client.

Any ideas are welcome!

Full Res: http://i.imgur.com/dkctWCF.jpg

Seems like they’re only being set visible on the server from that code, clients should not have authority so it’s odd that they would also print “It’s happening!”. Try calling the same code on the client or even just removing the switch has authority. Even though it’s being multicast it shouldn’t execute on the client due to that node.

Check that the references aren’t returning null on both the client and server also.

Sorry, I misspoke above, only the server is printing “It’s Happening!”. I tried skipping the Switch Has Authority and the result was the same. Though you have a good point with that. I am not getting any null reference or access none errors either.

The weird thing is that the collision is being enabled, since I am actually able to pick up the power up. It just isn’t visible.

I think I overlooked something basic here. You should be setting hidden in game, rather than set visible.

Also to ensure they’re set on the client, print the state, and check that it prints correctly on both client and server.

That didn’t work either.

When you remove the Switch has Authority it prints “It’s Happening!” on the clients? And with the switch removed, you can print each of the object names of your variables and they are all returning an actual object (not None)?

It prints “It’s Happening!” only on the server and the server prints the objects names just fine. Though the client is not printing them. Every single object is being returned.

What is the parent class of that blueprint, is it a game mode? Make sure you’re calling it from somewhere that actually exists on the client.

Game state is what I’d use for spawning powerups. Client is aware of game state but not game mode.

It is an actor class. That may be my problem though. I am calling it from itself. Maybe adding the game mode as a middle man is what I need. I will update after I get a chance to try it out!

Got it! I ended up changing my Replicated PowerUpSelection enum to RepNotify. Then if the actor had random selected I use an authority guard so the server is the only version that can pick a random power up.

Full Res: http://i.imgur.com/qiD4Pbs.jpg

When the PowerUpSelection variable is changed it forces the function OnRep_PowerUpSelection (Automatically generated when the variable is set to RepNotify) to be called on all of the clients. I use that function to set all of the collision and visibility needed.

Full Res: http://i.imgur.com/TrHv01X.jpg

@Vaei I appreciate you helping me sort through everything. Got it solved!