Hey devs,
I’m not sure what to name this post because I can’t tell very well what’s going on.
I made a very simple DVD Screensaver, and everything works fine when I play it in the editor, but when I’m playing from the Roblox client, whenever the logo hits a side of the screen, it stops for a bit before moving again.
Here’s video demonstrations:
In Editor:
In Client:
This code executes when the logo hits a corner:
-- Bottom Right Boundaries
if DVD.Position.X.Scale >= 0.891 then
xdirection = xdirection * -1
SideHit()
end
if DVD.Position.Y.Scale >= 0.855 then
ydirection = ydirection * -1
SideHit()
end
-- Top Left Boundaries
if DVD.Position.X.Scale <= 0 then
xdirection = xdirection * -1
SideHit()
end
if DVD.Position.Y.Scale <= 0 then
ydirection = ydirection * -1
SideHit()
end
This is the SideHit() function it’s linking (and the color function it links as well):
local function SideHit()
Side_Touched_Times.Value += 1
ThisSession_SideHits += 1
SwitchColor()
SideTouched:InvokeServer()
end
local function SwitchColor()
local Colors = {
Color3.new(1, 0.121569, 0.0431373),
Color3.new(0.0823529, 0.0823529, 1),
Color3.new(0.552941, 1, 0.254902),
Color3.new(0.439216, 0.180392, 1),
Color3.new(1, 1, 1),
[...]
}
local Color = Colors[math.random(1, #Colors)]
DVD.ImageColor3 = Color
end
My only theory is that maybe the client waits for a server response or holds for a little bit when invoking the server?
Sorry for the low quality post, and thanks for any and all help in advance.
Edit: Uploaded videos instead of using streamable