Animation Lagging?

  1. What do you want to achieve?

An Animation that works ingame just like it was animated.

  1. What is the issue? Include screenshots / videos if possible!

If I play the Animation, in Studio it works just fine,
Ingame however, It just begins to lag.

I included a Video Showing the Difference:

  1. What solutions have you tried so far?

-I did already look up some solutions on the Developer Hub but it didn’t work for me.
-Moving the Camera Back and Forward to see if this is Cam-Related. It wasn’t.
-Setting the Hipheight of the Character
-Reuploading Animations

If it Matters somehow, even though it works fine on other rigs, Here’s my Code [LocalScript]:

local function typewrite(object,text,length)
	for i = 1, #text, 1 do
		object.Text = string.sub(text,1,i)
		wait(length)
		print(length)
	end
end

local TextLabel = script.Parent

local Cam = game.Workspace.CurrentCamera

local Player = game.Players.LocalPlayer

local HumanoidPlayer = Player.Character:WaitForChild("Humanoid")

local TrashBot = game.Workspace.IMPORTANTSCRIPTING.TrashRobotSpots.TrashBot

local Sounds = script.Parent.Parent.Sound

--

local CutFolder = game.Workspace.Cutscenes.GetTrashbot

local Anims = CutFolder.Anims

local UserInputService = game:GetService("UserInputService")

local LoadRobot = Anims.Parent.Chars.TrashBot.Humanoid:LoadAnimation(Anims.Talk.Bot)
local LoadCam = Anims.Parent.Chars.CamRig.Humanoid:LoadAnimation(Anims.Talk.Cam)
local LoadRobotTalk = Anims.Parent.Chars.TrashBot.Humanoid:LoadAnimation(Anims.Talk.BotTalk)
local LoadRobotTalkNo = Anims.Parent.Chars.TrashBot.Humanoid:LoadAnimation(Anims.Talk.BotTalkNo)

local LoadRobotThink = Anims.Parent.Chars.TrashBot.Humanoid:LoadAnimation(Anims.Talk.BotThink)
local LoadRobotPoint = Anims.Parent.Chars.TrashBot.Humanoid:LoadAnimation(Anims.Talk.BotPoint)


function StartTalk()
	
	UserInputService.MouseIconEnabled = true
	
	LoadRobot:Play()
	LoadCam:Play()
	wait(0.5)
	
	script.Parent.Parent.Visible = true
	
	
	Cam.CameraType = Enum.CameraType.Scriptable
	Cam.CameraSubject = Anims.Parent.Chars.CamRig.Cam
	Cam.CFrame = Anims.Parent.Chars.CamRig.Cam.CFrame
end

function EndTalk()
	
	UserInputService.MouseIconEnabled = false
	
	script.Parent.Parent.Visible = false

	LoadRobot:Stop()
	LoadCam:Stop()
	wait(0.5)

	Cam.CameraType = Enum.CameraType.Custom
	Cam.CameraSubject = HumanoidPlayer

end

function ReallyStart()
	StartTalk()
	
	if Player.leaderstats.TrashMission.Value == 1 then
		
	else
		
		script.Parent.Parent.Options.Option1.Visible = true

		script.Parent.Parent.Options.Option2.Visible = true
		
		script.Parent.Parent.Options.Visible = false
		
		--normal Dialogue!
		
		script.Parent.Parent.Visible = true
		
		Sounds.TalkNormal:Play()
		
		
		
		typewrite(script.Parent,"Hey there Usually I'm just here to get the trash away.", 0.01)
		
		wait(2)
		
		Sounds.TalkHappy:Play()
	
		LoadRobotTalk:Play()
		LoadRobot:Stop()
		typewrite(script.Parent,"But I need some Metal, Can you bring it to me?", 0.01)

		LoadRobotTalk:Stop()
		LoadRobot:Play()
		
		wait(1)
		
		Sounds.TalkHappy:Play()
		
		LoadRobotPoint:Play()
		LoadRobot:Stop()
		
		wait(0.3)
		
		LoadRobotPoint:Stop()
		LoadRobot:Play()
		
		typewrite(script.Parent,"I heard there was a Guy that can somehow Convert Garbage into Metal.", 0.01)

		
		wait(2)
		
		Sounds.TalkHappy:Play()
		
		LoadRobotTalk:Play()
		LoadRobot:Stop()
		
		typewrite(script.Parent,"I think he can help you with it. Will you do it?", 0.01)
		LoadRobotThink:Play()
		LoadRobot:Stop()
		
		wait(0.8)
		
		LoadRobotThink:Stop()
		LoadRobot:Play()
		
		wait(1)

		
		script.Parent.Parent.Options.Visible = true
		
	end
	
	
end

function Idont()
	
	Sounds.TalkAnnoyed:Play()

	typewrite(script.Parent,"Oh.", 0.1)
	wait(0.5)
	Sounds.TalkSad:Play()
	typewrite(script.Parent,"Okay then...", 0.02)
	
	LoadRobotPoint:Play()
	LoadRobot:Stop()
	
	wait(0.3)
	
	LoadRobotPoint:Stop()
	LoadRobot:Play()
	
	wait(1)

	script.Parent.Parent.Options.Visible = false
	
	script.Parent.Parent.Options.Option1.Visible = false
	
	script.Parent.Parent.Options.Option2.Visible = false
	
	game.ReplicatedStorage.Remotes.QuestDecline:FireServer(Player)
	
	EndTalk()
	
	
end

function Accept()
	game.ReplicatedStorage.Remotes.QuestAccept:FireServer(Player)
	
	Sounds.TalkHappy:Play()

	typewrite(script.Parent,"Thank you!", 0.02)
	wait(1)
	
	Sounds.TalkNormal:Play()
	


	typewrite(script.Parent,"you can just find me here in the city.", 0.02)
	
	LoadRobotPoint:Play()
	LoadRobot:Stop()
	
	wait(0.3)
	
	LoadRobotPoint:Stop()
	LoadRobot:Play()
	
	wait(1)
	
	Sounds.TalkHappy:Play()

	typewrite(script.Parent,"See you!", 0.02)
	wait(0.5)
	
	EndTalk()
	
end

script.Parent.Parent.Options.Option2.MouseButton1Down:Connect(Idont)

script.Parent.Parent.Options.Option1.MouseButton1Down:Connect(Accept)

game.Workspace.IMPORTANTSCRIPTING.TrashRobotSpots.TrashBot.Head.ProximityPrompt.Triggered:Connect(ReallyStart)

Also for the Code Here’s the Structure of the UI:
Unbenannt

Hopefully someone can Help!
-Thanks!

Maybe try making it client sided, it won’t move exactly in sync with other players but it should reduce lag, if you try that and still have an issue then, could also just be your device, I find gameplay in studio way smoother than ingame however there is probably a fix to your issue.

It’s a single-player game and I’m already running the animations on the client.
But I don’t know why it doesn’t work since I made cutscenes in the same game and they were fine.

Also If I Play in Studio it has the Same Error.
With Studio I mean “Roblox Studio”
And With Ingame “Roblox Studio” Running the Game.

I was a bit confusing there, Sorry.

Try changing the weight of your animations. I’m not sure if this will help, but check this link out and try it:

Well as of now, I tried 1,5 and 100
Sadly No Difference.
Still the same Issue.

Quick Update, the Animation Gets Smooth after the Cam was Infront of the Character for like 4Minutes.
On every Single Other Character The Animations Are Smooth Instantly.

It can’t take that long since every animation is just Smooth!
Just not that one.
Can somebody still help?