Overlap component is replicated but i don't know why

Hello everybody !
I have a little problem. I’m doing a multiplayer game and I want to do a simple function where when the player approaches an item, a text is displayed on HIS screen. So I use the “On Component bergin overlap” node to detect when the player approaches the item, but the text is displayed on the screens of all players…

Help me please :sob:

I use the BP Third Person Character with all the basic parameters

  1. You need to create widget for every player individually.
  2. Use IsLocalPlayerController to create the widget and make sure every local player controller has it’s own instance of this widget.
  3. When Pawn makes a collsion, notify it’s local player controller that it needs to show the text.

This way you will show the text only to the player which had the collsion with the item collision.

Pawns and Controllers are usually replicated so you have to do: Self → DoOnlyIfLocallyControlled > Do stuff

It works thank you omg
For those like me who are new to unreal, here is a screenshot of my blueprint to solve the problem.

Also one thing to keep in mind is that when you have a non player controlled instance of the same Character, you might wanna additionally use “IsLocallyViewed”.

If the Character is not ViewTarget, then you might not want to tell the nonviewtarget character to access references that are not valid.

1 Like