Hey, I have been trying to create a recoil system but I am not sure how to set the players look direction.. Could anyone help me with that? I tried editing CharacterInterpolatedData's aimYaw and aimPitch, but nothing seemed to happen. Thanks
We tried this and it didn't work out too well as it seem that the server didn't always approve of the recoil in time. This lead to the recoil actually happen before a shot was fired. So it worked like 85% of the time. We never found a solution and moved on and removed it from the game (for now).
It could probably be done by delaying the recoil a server tick to make sure it actually fired the weapon first. But again, we moved on so I have other task on my plate before I can look into that again.
You could try to calculate the recoil only on the server and predicting it to the client. I implemented in a diffrent project something simelear, where a had for evry weapon recoil patterns. So i made a GUI Editor script where you can draw the recoil pattern and the script translates each point of this pattern to a x/y offset of the weapon. the server and client than calculating the recoil position depended on the shoots fired till recoil reset.
I am not understanding this question, Why are you trying to network recoil? Someone said "recoil happen before a shot is fired" This sounds very wrong. recoil should be client predicted along with the shot(s). So in other words, let the player shoot, and apply recoil on the client. On the server simulate recoil, and check shots. If a hacker wants to mess with recoil client-side, let them as it wont have an effect on whats really happening on the server on a server authoritative model. This works really well if you have a set recoil pattern, which if you have a competitive shooter at all, you need. If your recoil pattern is random that is much harder problem.