i was trying to sync the ball in my pong game but something i don't understand is wrong, basically the ball starts vibrating like it's lagging a lot, here the code
edit:
I think I’ve figured out what the problem is, is like the ball always goes back in time a few milliseconds, because when I say "at event 2 set the position..." the ball will have already changed position in my local instance, then at the trigger of that event the server will update the position of the ball with an old datum. So basically, how do I synchronize the ball based on the server? I mean, how do I get the server to calculate the direction of the ball?(can it be done with photon?)
the game if you need it:
https://mega.nz/file/70sixIjJ#2WGDkSjYb1rS3R6TvxQtrVE6hBcsyn1IJ9DX1Mnm2NM