I used X-ray detection to detect if the ball collided with a star and destroyed it, but why is there a delay in destruction when it collides?
I’m assuming its a server script, and it is kinda expected for things on the server to be a bit slow when replicating back to clients
Yes, he is a server-side script. Is there any way to solve this delay
implement the logic for the client too, but instead of destroying it, hide it temporarily. Wait a few seconds and if the object still exists then unhide it
This is due to latency which is a common issue with projectiles. When you set the network owner to player, you’re giving their client ownership of that part. The client detects touch then sends a signal to the server, but that signal takes time so theres a delay before it’s destroyed.
The simplest way of fixing this would be to create a projectile prediction local script, fire a remote to tell it about new projectiles, and run the same touch detection code you showed to destroy the projectile when it hits something.
