Replicating line trace problem

Hey guys, so the server line trace doesn’t show properly on the other clients where as the clients work perfectly as intended, any ideas? Been scratching my head for last few days over it and finally gave in to asking hehehe

Do your character and weapon-actor replicated?

Try to use LineTrace event as “Run on Server” RELIABLE

Yeah i’ve tried so many things and it stays the same :confused:

  1. Set up a server-executed custom event.
  2. Set up a client-executed draw trace event.
  3. Call the server-executed custom event that triggers the client event draw line trace at xy
  4. All clients will receive the event.

(the server cannot draw things, it is a server - beep boop)

you are executing on all but how do the other clients know which is the source of the line trace? you (as client) have to pass the source pawn to a RunOnServer event, that RunOnServer has to replicate all, passing the pawn reference, and then cast it to your soldiercharacter and start getting the components from that cast. that way you are telling everyone “ok guys, this pawn just made a line trace from here, to there, replicate it on your screens”. hope it helps and tell me how far you get with that.

This will probably work, i’ve got a similar setup with ragdolls and it works. My current linetrace setup uses a multicast, it seems to be abit inconsistent. (sometimes events won’t fire on server eventhough they should). I’m going to try this out later and report my results.

-SamuelB

2 custom events needs:
first RunOnServer than Multicast it!

try this… Legend O= Player One 0=Player 2 G=Player 3

this was my issue

Player one shoots line trace on client.
G O----------0
Player one shoots line trace fully replicated
this is player ones screen
G O----------0
However this is players 2 and 3s screen
G----------O 0
therefore player one has just killed both players 2 and 3 without even knowing how he killed player 3 lol

Easy fix, do not replicate your line traces, replicate your Hit condition and Hit results FROM your line traces :slight_smile:
(works well even with damage system)

now it looks like this
Player Ones Screen
G O--------0
Everyone elses Screen
G O 0

But everytime the line trace on Player ones screen hits something, thats when you are golden with replication and gets rid of all line trace calculation functionality issues replicated to the server, it just applys the damage, plays the effect, and spawns a bullethole decal wherever player ones line hits ;D

Dodgin suggested having the client execute the trace, but the server tells the client to execute it. Then the server isn’t drawing anything :slight_smile: