Make components of other Players hidden, local only?

hi there…

I’ve a small setup, where two players speak in a Map.
Since the Game should be a coop-rts-rpg (yes… Weird mix…), each player has a possessed Pawn Actor, that holds a Camera on a SpringArm and a Decal Component, as Cursor on the Map.

This Cursor Decal is replicated to the other Player… So, each Players sees, where the Cursor of the other one is.

Now… I want to make it possible for a player, to hide the other Players Cursor decal (so only his own is visible).

Therefore, i added a simple bool in the GameInstance, that can be set by the player via his Game Settings.

Now the Question:
How can i set the decal of the Actor of the second Player to be visible or not, by the HideCoopCursor bool of the GameInstance?

You can check whether the controller of the pawn is a local PlayerController with the Is Local Player Controller node (or corresponding C++ function.)
So, in Event Begin Play in the pawn, and also when the setting changes, get the pawn controller, and check whether it’s local. If the setting for “hide” is on and it’s not local, then hide the cursor.

2 Likes

worked great, thank you very much :smiley: