Camera Line Cast From Server Not Working

I am making a online multiplayer game and I want the line traces to run on the server to prevent cheating. I am line tracing from the players camera forward first and then from the gun point to the point that hits, or the end of it to accurately shoot from the crosshair. The line trace from the guns work both client side and server side, but the line trace from the camera on the client side traces from a random point and not where the camera is. I know that this is a problem with the locations of the other player’s cameras on the server, but I followed another forum that said that it would fix it, and it didn’t. Below is the blueprint for the line trace from the camera. Please help.

Just a guess but The server likely dosent know the loacation of the cameras or the change in it rather… it probably thinks its still at the same rotation that it spawned at but knows its moved location beacuse the player did

You can test for this by spawning the character facing your test wall, disable the IA_look by temporarily unhooking it… try shooting if you get the result expected then the server just dosent know the cameras rotation…

Youll probably find overall its easier less data sent and probably better practice to just check that the location the player is trying to shoot is within some parameters

What id do is have the line trace on the client and a line trace on the server… the client sends over the point that it hit to the server and the server just checks if its within some distance from the location that it got from its line trace just straight out at gun height

Ex player gets 0,0,50
And the server got 0,0,0 thats a distance of 50 and close enough to still be accurate, you can then accept the players hit result and do damage or whatever with it

I would like all the line traces to run on the server as to prevent cheating, even to a tiny degree. I think the camera thing could be the problem, but I don’t know how to do that, so if someone would help me, that would be greatly appreciated.

This isin’t ideal for multiplayer as i suggested above

Just as an example because it’s an fps, imagine you have 32v32 you now have 64 players replicating a value every time they move their mouse for the occasion that they shoot something

But I’ll help never the less,
When the player rotates the camera in any way ( IA_Look ) set a variable with the transform of the camera… Replicate this value, plug that in in place of your select node

Very similar to this

I am open to the other method, but I have no idea how to do it. If I could, then I would do that. If you know how to that, that you be great help.

If this is hard for you atm, not to be mean or rude or anything but perhaps you should start somewhere else on your game project… replication only gets more crazy from here

if im wrong, forgive me…

In the camera component you can always click on replicate component and make sure the character itself has replication on ( by default it does ), This might make your existing code work

Or the controls that you use to move the camera theres an event node called “IA_Look” after it does everything that it does already add a transform variable set it to replicate and use that value instead on your select node that you have in your picture above

I figured it out. I had the camera attached to the head and not the capsule component, meaning any animation, including the tilting of the head for the gun animation, made it slightly off. Thank you so much for helping me.