SetOwner + EnableInput = lost connection?

Hi Guys,

I am trying to control an AActor with any player controller.

The AActor is spawned on the server.

When spawned with SpawnParams.Owner = this, then only the client that requested the spawn can take controle of it: EnableInput(PC) works only with the original PC, not with other clients PC.

When spawned with no Owner parameter (Owner = NULL) then the input will be enabled for no one.

When i try to manually define the Owner with SetOwner(PC), the ownership seems to be granted correctly (i checked with debug messages) but then the connection is lost as soon as i call EnableInput.

I tried to call SetOwner and EnableInput both on client and server (all 4 combinations), i tried to replicate the PC.

I just can’t take control of the AActor if it has been spawned with no Owner.

Can someone tell me how to do that ?

Thanks

Cedric

Apparently SetOwner has to be called on the server (which makes sense) and EnableInput on the client (which also makes sense.

But it takes some time to SetOwner to replicate the owner, maybe that was my problem.

I solved it by calling SetOwner both on server and client.