Download

Get owner won't work for overlap in multiplayer? Related to fog of war

Hi, my goal is:

in multiplayer game make localy invisible enemy characters until they come in sight of your character

What i tryed:

on 3d sidescroller template added cone to character blueprint and changed it’s collision settings https://yadi.sk/i/0DkOfjdHhZWeZ , also added 2 overlap events to cone “On Component Begin” and “On Component End overlap”

character capsule collision settings https://yadi.sk/i/gNweEpwbhZWdv

In character blueprint i try compare owners of cone and pawn that overlaped with simple code https://yadi.sk/i/oY-GCKf9hZWhv

Problem:

during test client can’t get “other actor” owner and server can’t get owner from “get player character” at index 0 https://yadi.sk/i/nVOzzfFLhZWj6

Any ideas what wrong or how else compare pawn owners to not hide your own character that overlaps with cone and hide enemy character on “Event begin play”? (this event executes 4 times total, 2 times on each side client/server once for every character)

PawnOwner would be the PlayerController. A Client only has its own PlayerController. That’s why he can’t get the Other Actors owner.

The Server on the other hand should be able to get the owners, since he has an instance of all Controller.
But you don’t want to use “GetPlayerCharacter0”, since this would be the Server PlayerCharacter.
If this overlap happens inside of the PlayerCharacterBP, you should just use “GetOwner” with “self” instead of “GetPlayerChacter”. It will then get the Owner of the CharacterBP where
the Overlap call happened.