Blueprint Networked Poker How the heck do you replicate a "hand" for only one client?

Hi Unreal Community!
I’m running through my first replication tutorials. Most of it’s pretty clear…but I’ve been scratching my head over this problem. Can anyone help?

I’m not actually making a poker game, but this is the clearest example of what I’m trying to accomplish:

Imagine a poker game build entirely with blueprints (I haven’t touched C++ in close to twenty years!).

The way I figure it all the deck and card management stuff needs to be done exclusively on the server, in the gamestate class, (that’s seems to be what it’s for?) with the client being “told” what cards it has, rather than it being able to generate them itself. I spawn (or try to spawn) visual representations of these cards on the client.

These visual representations of cards are actual Blueprint actors with static mesh components themselves, and I spawn them in front of the player’s camera.

However, I can get them to spawn on ALL clients (using multicast) or on ONLY the server (using Run on Server). Is there a way to spawn them on ONLY a particular client so that each player ONLY sees their hand?

I mean, I might be able to fake it by hiding/unhiding meshes and such, but that seems like it might not be as secure as the server simply only telling each player what they should know locally. I’d hate for someone to hack around and check out everyone else’s hands, you know?

Any thoughts on the best way to handle this? Thanks!

You can set it to ‘Only relevant to owner’. It will exist on the client that owns it and server. It should be in the properties of the actor. Is that what you mean?

That could be what I’m looking for. I’ll give it a try tomorrow and see if that does the trick. thanks! :slight_smile:

OK, I gave it a go.
So, “only relevant to owner” in the BP defaults doesn’t do the trick… However, that led to me discovering you can set a custom event set to “Run only on owning client”–that seems to do the job…if I use such an event within a pawn then the server GameState can then pick a player/pawn and run it in order to get the cards to spawn locally per pawn. The resulting pawn will be the “owner” of the visual representation of the cards.

I’m not sure if I need “only relevant to owner” checked on the blueprint as well…with that custom event setup it seems to work both with and without that option checked, but I haven’t done to much testing yet on it. Thanks for steering me in the right direction!