Problem with trying to replicate my custom mouse rotation to all the clients
I'm working on multiplayer FPS project with some custom mechanics for which i need custom mouse function. Problem is, mouse cam rotation works only on clients, but not on server, thus when client 1 rotates his camera angle, it is not showed to client 2 and client 2 sees client 1 as always facing forward.
Here's what i mean: https://1drv.ms/v/s!AmOWr-Yw7oVtgY8DjWXL9cuLG-y_eA
As shown in video, clients are not telling server that they changed view angle. This is my mouse function:
Initially i tried this replication method:
Basically i cast function to all clients and tells server that clients are using this function, and mouse-server event is refreshed on every tick. But it's not working.
Then i tried something else, i created replicated rotator variable and tried to expose it to server Here it is: https://i.imgur.com/lNqj49m.jpg
It's not working, disables keyboard and mouse input, and just showed me this error: Blueprint Runtime Error: Accessed None trying to read property CallFunc_GetController_ReturnValue from function: 'MouseInput' from node: Branch in graph: MouseInput in object: BP_PlayerCharacter with description: Accessed None trying to read property CallFunc_GetController_ReturnValue
Basically i'm lost and i'm desperate for help.
I have tried multiple way to try and make it work and nothing, this is also in BP and the engine being used is the 4.18 any ideas or help would be greatly appreciated.
Thanks in advance.
asked Apr 22 '18 at 05:28 PM in Blueprint Scripting
I do not see anywhere that is calling the Mouse-Server event. I think that would solve the problem if you call that event whenever the rotation changes on the client.
answered Apr 25 '18 at 11:59 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here