Getting the owner of an actor [multiplayer]

williambradsahw
Mon, 04 May 2015 22:07:21 +0000
Multiplayer & Networking

I’ve got two players in multiplayer, one server, one client.

I’m trying to get the owner of the AActor parameter from the boxTrigger in the level but have only been met with failure.

The onActorBeginOverlap event occurs twice for one overlap made by the client. Once on the server, and once on the client. GetOwner doesn’t really seem to work, and using HasAuthority with the Actor param does the same exact thing as the sequential hasAuthority. When a client triggers the event how do I either

A) keep the same event from triggering on the server,

or

B) determine who owns the AActor that is overlapping with the boxTrigger.

Essentially I only want the server to do x, y, and z once, when the server’s character overlaps with the boxTrigger. I don’t want the server to do anything when the client’s character overlaps. So I must be able to determine who controls which character.

Is this making sense?

I’ve used getOwner->getDisplayName but it’s just an empty char in a string.

I’ve also used getOwner->hasAuthority(AActor owner) and it always returns false.

6 posts - 1 participant