#Fps drop on any input
46 messages · Page 1 of 1 (latest)
cant really show code since i do not know the source of the issue, i need help finding the source, i need to know what could be causing this in the first place
then how am i ment to help you fix code which you dont know of the issue with
you're probably connecting to uis every frame, beginners tend to make that mistake a lot
so whenever you press a button it fires a million times and just gets worse over time
alright ima check that out thanks a lot
because i need help with figuring out what could be causing issue first
but i think i got it now
I tested it by deleting all of the GUI's and its still happening, I will record the issue and it might help a bit
where code
hold on im gonna try the gui part again
i might have figured it out
its already present even before i press any button but it might be this hold on
local PlayButton = script.Parent
local playGui = PlayButton.Parent
local teamSelectGui = player:WaitForChild("PlayerGui"):WaitForChild("TeamSelectGui")
local camera = workspace.CurrentCamera
local cameraPart = workspace:WaitForChild("Cameras"):WaitForChild("cameraPart")
local character = player.Character or player.CharacterAdded:Wait()
local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
local playerModule = require(player:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule"))
local controls = playerModule:GetControls()
controls:Disable()
humanoidRootPart.Anchored = true
local function setCameraToPart(part)
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = part.CFrame
end
local function resetCameraToPlayer()
camera.CameraType = Enum.CameraType.Custom
camera.CameraSubject = player.Character:WaitForChild("Humanoid")
end
local function disableAllGUIs()
for _, gui in pairs(player:WaitForChild("PlayerGui"):GetChildren()) do
if gui:IsA("ScreenGui") and gui ~= playGui then
gui.Enabled = false
end
end
end
-- Enable all GUIs
local function enableAllGUIs()
for _, gui in pairs(player:WaitForChild("PlayerGui"):GetChildren()) do
if gui:IsA("ScreenGui") then
gui.Enabled = true
end
end
end
setCameraToPart(cameraPart)
disableAllGUIs()
PlayButton.MouseButton1Click:Connect(function()
controls:Enable()
humanoidRootPart.Anchored = false
playGui.Enabled = false
teamSelectGui.Frame.Visible = true
resetCameraToPlayer()
for _, gui in pairs(player:WaitForChild("PlayerGui"):GetChildren()) do
if gui:IsA("ScreenGui") and gui ~= playGui then
gui.Enabled = true
end
end
end)
for _, button in pairs(teamSelectGui:GetDescendants()) do
if button:IsA("TextButton") or button:IsA("ImageButton") then
button.MouseButton1Click:Connect(function()
if not teamSelectGui.Frame.Visible then
button.Active = false
else
button.Active = true
end
end)
end
end
you can also use script performance
code of a play button
which will show you what scripts are doing
i didnt make the code since im the vfx designer so i dont know what my guy messed up here
ooh ty
yeah i used it in the vid i sent
every time i press a button the micro profiler goes up
like this
how do i change it
alright 1 sec
do i like switch it here?
i never used micro profiler before
oh i think i got it
i dont have any groups selected, not even ALL and it still looks like this
okay i realized its one of these scripts, since when i disabled them the issue was solved
i will return later
** You are now Level 7! **