Linetrace by Channel giving incorrect result

The project plays as a listen server. When i move one of the chess pieces, it calls a function to update its position along the z axis so that it aligns with the terrain. This is done through a linetrace by channel and on the client side (black) it works perfectly fine. However, on the server side (white), the linetrace somehow always results in the exact same z value. Why is this?


What’s the Z value you’re always getting ?

Could be a channel issue, or a server-client issue I think
For channel, print the actor that the server Z linetrace is hitting, this could point you in a direction
For client-server, make sure all of your actions are replicated, it’s possible that the piepce is moving on your screen as predicted but is not moving on the server/client properly

I also believe that it might be related to replication. However, as you can see the piece does move on both sides. Also the z value that the white pieces move to (378) seems quite random so I am not sure where that is coming from.

I also tried doing it as a server-side event but this didn’t make any difference.

What confuses me is that the function works perfectly fine for both sides on begin play but not when moving a piece.

In that case it’s probably not a replication issue

Unless there’s something else I’m not thinking of, then it would be the line trace colliding with something else

What does your print say for the actor being hit?
is it what you’re expecting?

Thank you, for some reason I hadn’t thought of actually checking which actor it hits…
Turns out it was hitting the highlights that show which tiles the piece can move to :man_facepalming:.
All fixed now!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.