Hey!
In my game, a lot of parts fall from the sky.
Its just a fun little part of the game that can be toggled in the games settings, but Ive experienced a LOT of lag with this.
Currently, the parts (called Bricks) fall from the sky using a tween with the “Bounce” EasingStyle, and I believe that might be causing the lag.
Should I swap to custom animations for better performance?
Oh and I forgot to mention that there are about 200 bricks falling per second. How would I go about loading the animations? Wouldnt it also be laggy to load in hundreds of animations seperately?
Alright, also the part creation cant be the biggest issue since the game runs smoothly if the animations are disabled. microprofile-20250304-133504.html (9.0 MB)
No, thats not possible since the falling bricks are the main part of the game.
The tweening doesnt look choppy or anything, the game just gets reduced to 0.5 FPS.
Also, I chose Bounce because it looks realistic. Bricks just gliding down linearly would probably look… questionable.
local player = game:GetService("Players").LocalPlayer
local ar: RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("ClientFXEvents"):WaitForChild("AnimateBuilders")
local bricksFolder = game:GetService("Workspace"):WaitForChild("ClientBricks")
local ts = game:GetService("TweenService")
local toggle: BoolValue = player:WaitForChild("Settings"):WaitForChild("BrickAnimations")
local random = math.random
local AnimateBulldozersEvent = game:GetService("ReplicatedStorage"):WaitForChild("ClientFXEvents"):WaitForChild("AnimateBulldozers")
local points = game:GetService("Workspace"):WaitForChild("BrickSpawn1"):WaitForChild("Builders"):WaitForChild("Points")
local RunService = game:GetService("RunService")
local BulldozerScale = game:GetService("ReplicatedStorage"):WaitForChild("Bulldozer"):GetScale()
-- Load Tweens --
local FallTweenInfo = TweenInfo.new(1.25, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out)
local TransTweenInfo = TweenInfo.new(1, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out)
local function AnimateChild(child:Instance)
child.Transparency = 1
child.Orientation = Vector3.new(0, random(0, 360), 0)
if child.Name == "BrickD" or child.Name == "BrickE" then
child.Orientation = Vector3.new(random(-25, 55), random(0, 45), random(-25, 65))
end
child.Position = Vector3.new(child.Position.X, child.Position.Y + 40, child.Position.Z)
local FallTween = ts:Create(child, FallTweenInfo, {Position = child.Position - Vector3.new(0, 40, 0)})
local TransTween = ts:Create(child, TransTweenInfo, {Transparency = 0})
FallTween:Play()
TransTween:Play()
task.delay(TransTween.TweenInfo.Time, function()
TransTween:Destroy()
FallTween:Destroy()
if child.Name == "BrickD" or child.Name == "BrickE" then
child.Position = Vector3.new(child.Position.X, child.Position.Y+2, child.Position.Z)
end
end)
return
end
bricksFolder.ChildAdded:Connect(function(child: Instance)
if toggle.Value == true then
do
local function animate()
AnimateChild(child)
end
local Cor = coroutine.create(animate)
coroutine.resume(Cor)
end
else
child.Transparency = 0
end
end)
Could you try sending the file again, but removing the file extension completely, or making it a .txt?
That way, my phone will have to download the raw thing rather than open it as a webpage and download that…
Sorry for the troubles