SetOwner + EnableInput = lost connection ?
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 ?
asked Dec 20 '14 at 11:20 PM in C++ Programming
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.
answered Jan 11 '15 at 10:27 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here