Multiplayer FPS Line-Tracing-Weapon Problem

Hello guys!
I have made a simple Multiplayer FPS Blueprint with a Line-Tracing-Weapon System.

Most of the “coding” was inspired by the Blueprint-Networking Tutorial from the UE4 youtube channel,
and I think it can probably be improved in a thousand ways and it may be very inefficient.

This is my basic shooting setup:

You may see here that I have almost no clue regarding networking in blueprints, haha.

This is the Shoot Projectile Function that is called (where the problem lies):

Basically, if I set [Get the Player Camera Manager] as the target at [Get Actor Location] and [Get Actor Forward Vector] (both on the left side here), everything works perfect, but ONLY for the server.

The client can then also shoot but every(!) shot hits the server, no matter the clients camera. It seems like the clients don’t get their lines traced.
If I just leave it out, it works but every line-trace is “delayed” by one shot.

Damage seems to work properly so far.

I think my problem can be summed up in one question:

How can I use Line-Tracing-Weapons in Multiplayer?

I wan’t Clients to be able to shoot each other with Line-Tracing.

Or are weapons handled totally different?

(And how can my “code” me optimized in other ways?)

Every piece of probably helpful information is welcome!
Thanks for your time and help
PS.: I can post the ShotFX and Make Damage Functions too, if it helps.

Why don’t you just send back to client the hit loc and actor loc in Shot FX multicast, if you replicate value it may already change when you get it.

Can you maybe explain it like I’m 10 years old? :smiley:
I thought I wouldn’t want to execute the line trace on the client to prevent cheating?

And: Can you maybe show/tell me the basics of a line-tracing-weapon in multiplayer with clients being able to shoot each other? How do I get the camera position (where he’s aiming at) of every player?

Thanks for your help :slight_smile:

Googled stuff, combined information and got it to work!
If anyone else encounters the same problem, here’s my (probably inefficient from a programmer standpoint) solution.

In the Event Graph:

Shoot Projectile Function:


I hope this helps some people.
I’m also wide open for code efficiency input from you guys!
Criticize the hell out of this stuff, please :slight_smile:

Thanks for sharing this!

“Get Control Rotation” is the magic I was looking for. Without this, the server was not including the camera pitch, for some reason…

This just helped me sooooooooooooooooooooooo much lol I have been having a problem with this for like weeks lol

Magic definitely. It’s obvious that almost everyone facing this problem. Look at the votes.