A Newly Created Part Momentarily Freezes in Air When Created/Force Applied Through Script

A Newly Created Part Momentarily Freezes in Air when created/force applied through script.

If I create a part through a server script inside the workspace, and apply an upward force to it through code, it should immediately start moving when it appears.

What actually happens: The part will appear, but for approximately 15 frames (or a short period of time) the part will stay frozen where it first appeared, not moving at all. And after that short period of time, it will begin moving.

This only happens on the client’s view, not the server’s view. Which indicates that it’s an issue with the networking.

This can be replicated by running the following code in a server script in the workspace of a blank roblox place (preferably the empty basplate template), and pressing the play button (f5).

wait(4)

local part = Instance.new("Part")
part.Position = Vector3.new(0,5,0)
part.Parent = workspace
part:SetNetworkOwner(nil) -- to make sure the owner is the server
part:ApplyImpulse(Vector3.new(0,500,0))

My assumption was that the client does not recieve the “part is created” message and the “apply force to part” message at the same times.

But through further testing, I have found that the client does know the updated velocity of the part even though it is frozen in air. This leads me to believe that the client is simply not interpolating the position of the part when it is first created. Which creates this unfortunate situation where the object does not immediately move, even when it should.

To test and confirm what I have just said, I made this local script which checks to see if the part has a non-zero velocity when it first appears on the client.

This script I put inside of ReplicatedFirst.

local part = workspace:WaitForChild("Part")
for i=1, 30 do
print(part.Position," | ",part.Velocity)
task.wait()
end

I have gotten console output that says:

“0, 6.49219274520874, 0 | 0, 70.3172607421875, 0 (x17)”

Which tells me that did move slightly up from it’s original position of (0,5,0), but then immediately froze in air.

I’m not sure when this bug started, but I started noticing it in the past few weeks.

So around early January, 2024.

Again, my assumption is that this is due to the client not performing any position interpolation to guess at where the part should be on the client.

Other Remarks

I have also noticed other strange behaviors that I can tell are related to this issue, involving trying to move the part on the client (with client scripts), and the part taking a bit of time to update to the part’s server position when the client stops manipulating the part’s position.
And I can include extra code demonstrating this as well. But I want to keep this report simple (for now), to put focus on the issue of the part being stationary when first created.

I am making a game where I spawn sphere parts as projectiles and give them a velocity right as they are created. So I expect them to move immediately, but they don’t. Which I find really makes the game feel unpolished.

I should also mention that I made a post in Scripting Support before trying to report this as a bug, looking for anything I could do on my own to fix this issue for all clients.

~Because I assumed an issue like this was known for a long time, and the consensus was that we have to write our Lua code in a certain way for this to not happen, or create a bandaid fix to prevent it when desired.~

Any of the solutions I tried, did not 100% fix the issue. I tried making a client script which interpolates the part position for 20 frames, but the part still froze mid air after the client script stopped moving the part.

1 Like

This is just an acknowledgment announcement!

We’ve filed a ticket into our internal database for this issue, and we will update you when we have further information!

Thanks for the report!