Hi, I’m currently working on a show case that lines up the next Model, inserts it etc.
However, for whatever reason when you switch between the different categories in-game the transition between each models seems to speed up, increasing each time.
https://gyazo.com/2ab568863eee0a513a243ae0668a6e89
The full code is below, Please do ignore my layout of coding - It’s simply my chosen method as it helps with my dyslexia.
repeat wait(.01) until workspace.Camera ~= nil
--||--||--||--||--
local Storage =
{Player = game.Players.LocalPlayer,
Camera = workspace["Camera"],
DisplayModel = workspace["Display"],
Objs = game.ReplicatedStorage:WaitForChild("Objs")}
local isDisplayed =
{Seekling = false,
Building = false,
Misc = false}
local DisplayValues =
{CurrentSeekling = 1}
local MaxSeekling = Storage.Objs["Seeklings"]:GetChildren()
--||--||--||--||--
--||--||--||--||--
local ViewPoint01 = Storage.DisplayModel["ViewPoint01"]
Storage.Camera.CameraType = "Scriptable"
Storage.Camera.CFrame = CFrame.new(ViewPoint01.CFrame.p + ViewPoint01.CFrame.LookVector * 15, ViewPoint01.CFrame.p)
local Gui = script["SelectionGui"]:Clone()
Gui.Parent = Storage.Player["PlayerGui"]
Gui["Frame"]["Seekling"].MouseButton1Down:Connect(function()
if isDisplayed.Seekling == false then else return end
isDisplayed.Seekling, isDisplayed.Building, isDisplayed.Misc = true, false, false
ValuesChanged()
return
end)
Gui["Frame"]["Building"].MouseButton1Down:Connect(function()
isDisplayed.Seekling, isDisplayed.Building, isDisplayed.Misc = false, true, false
ValuesChanged()
end)
Gui["Frame"]["Misc"].MouseButton1Down:Connect(function()
isDisplayed.Seekling, isDisplayed.Building, isDisplayed.Misc = false, false, true
ValuesChanged()
end)
--||--||--||--||--
--||--||--||--||--
function ValuesChanged()
for _,CheckDisplay in pairs (Storage.DisplayModel["OnDisplay"]:GetChildren()) do
if CheckDisplay then CheckDisplay:remove()
else end
end
--||--
if isDisplayed.Seekling == true then
DisplayValues.CurrentSeekling = 1
repeat wait()
Storage.Camera.CFrame = CFrame.new(Storage.DisplayModel.SpawnPoint.CFrame.p + Vector3.new(0, 2, 0) - Storage.DisplayModel.SpawnPoint.CFrame.LookVector * 5)
for _,CheckDisplay in pairs (Storage.DisplayModel["OnDisplay"]:GetChildren()) do
if CheckDisplay then CheckDisplay:remove()
else end
end
local ToDisplay = Storage.Objs["Seeklings"][DisplayValues.CurrentSeekling]:Clone()
ToDisplay.PrimaryPart = ToDisplay["Base"]
ToDisplay:SetPrimaryPartCFrame(CFrame.new(Storage.DisplayModel.SpawnPoint.CFrame.p) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), math.rad(-90)))
ToDisplay["Seekling"]["Head"]["Face"]["Decal"]:remove()
ToDisplay.PrimaryPart.Transparency = 1
ToDisplay.Parent = Storage.DisplayModel["OnDisplay"]
wait(1)
if DisplayValues.CurrentSeekling == #MaxSeekling then DisplayValues.CurrentSeekling = 1
else
DisplayValues.CurrentSeekling = DisplayValues.CurrentSeekling+1
end
until
isDisplayed.Seekling == false
else return end
--||--
end