- Objective: I’m attempting to create a smooth ball movement using BodyVelocity, currently im throwing the ball on the server and then im firing a clientEvent to all the players creating a clone of the server ball that goes at the same speed but smoother. However, I noticed that the serverBall becomes jittery when I create a clone of the ball and use BodyVelocity for the client side.
- Issue: When running two balls with BodyVelocities one one the server side and one the client side, the serverBall appears to lag and glitch, while the client ball moves smoothly. The issue can be better understood from the following GIF: GIF Link
- Attempted Solutions: I have tried using linearVelocity and other bodyMovers, but unfortunately, these approaches led to the same jittery behavior of the serverBall.
Ok for the serverBall have you tried to set its network owner?
like Ball:SetNetworkOwner(nil) this should reduce the lag.
But i don’t quite understand why are you moving 2 different balls like that?
I just tried setting the network owner to nil and it displays the same behaviour.The reason to create a client side ball its to display it more smoothly.
serverSide Ball
clientSide Ball
Both Together
Appreciating the difference in smoothness on a gif its difficult but there is a significant difference.
oh i see instead of using serverBall you can keep the client one.
You can use some event to tell server which position or speed goal and fire all clients to visual the ball movement on client
(sorry if it is hard to understand)
Yeah, I was thinking of just getting rid of the serverBall altogether, but the thing is, I’ve got a bunch of .Touched events on the serverSide ball to catch cheaters and detect when it’s caught. If I don’t handle some sort of ball on the server, people could easily cheat in the game. It’s like there’s some funky overlap with the physics engine causing that weird visual bug.
I suppose you can use the client for visual while server is for detect. That should make it work fine
Yeah, I’ve tried doing that, but when I combine the two balls, the serverBall starts acting all weird. And when I try to sync them and check their positions, the serverBall’s position is off, so they keep syncing way more than they should.
Yea its what im currently doing, this brings the problem im currently dealing with, where I check the distance between the client ball and the server ball every 4 seconds. If they’re too far apart, I fix the client ball’s position. But here’s the catch - the server ball keeps flickering, even when it’s not visible, messing up the accuracy of my checks. It’s a real headache!
Maybe i should post this on engine bugs.
I basicall solved this issue to sync the client ball to the serverBall perfectly by using a RigidConstraint, i hope it helps somebody facing the same issue.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.