Beam Texture Desyncing Bug

When a Beam is off screen, it stops rendering and its texture offset isn’t updated.
Under normal circumstances this wouldn’t be an issue, but in my use case I’m using beams to animate a scrolling texture on some individual conveyor belt blocks.

I think I can just switch over to tweening a texture offset on the client, but this seems like a bug and I figured it would be worth reporting. Fixing it would just require the texture offset to be refreshed to where it should be upon being visible to the camera again.

(cc @programeow)

14 Likes

Interesting discovery! I don’t recall anyone talking about beams being a lag creator so I wonder why this is implemented or it’s just a glitch.
And you know if this was actually a feature that roblox added that would be great to add it for other objects like the rope constraints so it stops calculating their movement once they are off-screen or maybe that’s already a thing

That runs on the physics engine, physics are not based on if an object is on the screen or not and run on the server most of the time.

The issue here is that each beam updates at a lower tick rate when it goes off screen just like particles. Because there are multiple beams in a line, turning your camera will cause beams to not be synced since they will be running at different tick rates to update their rendering.

(Or not I could be completely wrong :man_shrugging:)

1 Like

I see, there is really a lot of stuff that is roblox-physics related that I’m not open to

Imo beams should be based off of real time. Handling them separately on physics seems weird to me.

The one thing I can see that causing a problem for would be this: Beam | Roblox Creator Documentation

That function can also be used to implement time based offset for the conveyor animations @Maximum_ADHD.

Here’s an example script I made which you can see working below:

local RunService = game:GetService("RunService")
RunService.Heartbeat:Connect(function()
	for _, beam in ipairs(beams) do -- beams is a table with all beams needed to be updated
		beam:SetTextureOffset(1-(tick()%beam.TextureSpeed)/beam.TextureSpeed)
	end
end)

Roblox is without this change
Custom is using the above code
image
Here it is after the Roblox beam is desynced
image

As you can see in the first screenshot the beam is moving at the same speed. As soon as any desync occurs you can immediately tell that Roblox’s beams are not traveling at the same speed when off screen.

Edit: If Roblox were to update beams to use real time (which could maybe slightly reduce lag?) they would need to add (or subtract) the beam’s SetTextureOffset value to the real time based value to retain older functionality.

6 Likes

Make sense. I will fix it. Thanks for your report.

6 Likes