Hi again! I have built a bowling alley. But I have one problem: when the ball is about to hit the pins, it lags some very awful. This is probarly because there are many other pins as well.
And this is only when the ball is far away. When I go near the pins, then it acts like it should, but it is only then. And of course, it should do it when far away too.
And this issue seems to only occur in the following game. Other games are fine.
But I don’t know, because when the game starts, there are no falling parts, they are just standing like if they were anchored. But as fast as I’m knocking over them with a ball, it lags, even if it’s only one lane in motion at the time.
I have tried to lock all the pins by anchoring them when the lane isnt on, this works, but it is not what I actually want.
I have windows 11 operating system.
I have also maked sure the game is within the limit. (100GB is the limit, I have apprx 75GB)
So can someone help?
Sorry that I have posted much about this game.
I think the problem you are having is that when the ball gets far away from you, it’s network ownership changes, causing jitter.
If you don’t know how network ownership is handled by roblox, here’s how it works:
All unanchored parts have physics, and these physics are normally ran on the server, but, lots of physics calculations can strain the server. To combat this, roblox automatically gives network ownership to a player that is close by (if there is one). This means the player now handles the physics calculations, instead of the server, reducing strain on the server.
Your problem comes in when you get far away from the ball, and the ball’s network ownership automatically changes from you to the server, causing some jitter.
To fix this, just run this code when you create the ball:
ball:SetNetworkOwnershipAuto(false) -- Turns off automatic ownership switching
ball:SetNetworkOwner(nil) -- Sets the network owner to the server, just incase it's set to a player (you may not need this)
This prevents roblox from switching the network owner, hopefully preventing the jitter.