Hello, everyone! I’m working on my game and I’ve noticed really weird issue, when I sit on ANY seat in my game CPU time increases in MicroProfiler (from 4ms to 9ms) and I notice FPS drop for a few renders (from 300 to 100). Other players notice this issue too. I’ve attached screenshots from Microprofiler. This is my first time using Microprofiler so I don’t really know what I need to add in this post, would be happy if you tell me what I should do. Thanks for any help!
Game using R6 rig.
Also, sorry if I’ve posted it in the wrong section. I have one single script for character that plays animation depending on the seat, I tried to disable it and I haven’t noticed any changes.
Sorry, didn’t see that in the post. Try going into an empty game and create a seat, without any scripts present at all and see if the issue still occurs.
Must be something to do with your game then. How many other scripts do you have? (whether they are related to the seat or not), just wondering if you have a lot or a small amount.
I have a bunch of scripts but the only one works with seats. (Server)
I don’t think it may cause issue. Added below.
return function(Player: Player, Character)
local Humanoid: Humanoid = Character:WaitForChild('Humanoid', 9e9)
local track
local Animation
Humanoid:GetPropertyChangedSignal('SeatPart'):Connect(function()
if track then
track:Stop()
end
local SeatPart = Humanoid.SeatPart
if SeatPart and SeatPart:GetAttribute('SitAnimation') then
Animation = Instance.new('Animation')
Animation.AnimationId = 'rbxassetid://' .. SeatPart:GetAttribute('SitAnimation')
Animation.Name = 'sitAnimation'
track = Humanoid.Animator:LoadAnimation(Animation)
track:Play()
end
end)
end
Yes. It’s modulescript that being fired with following code
local function characterAdded(Character)
for _, v in pairs(modules.character) do
task.spawn(v, Player, Character)
end
end
if Player.Character then
characterAdded(Player.Character)
end
Same result. Disabled all localscripts in StarterCharacterScripts, StarterPlayerScripts, StarterGui. I suppose it could be related to building. Thank you for trying to help me. I think that’s all.
Alright, good luck on finding the issue! (I really have no idea, I think it must be somehow related to another script you have which doesn’t seem to be related to seats, or building like you said)
I was just wondering if you’ve put a free model in there, or used a malicious plugin (or in TeamCreate a friend has used a plugin) that’s making the lag occur.
Also, you are loading the animation every time a player changes a seat property in that script.
Load it in the Players at the beginning of the script so it doesn’t load every time, then just play or stop it.
Is the seat unanchored or welded to an unanchored part? Sitting on an unanchored seat causes CPU times to increase dramatically, I’m unsure why that is the case.