Animation Lag [Studio Game, And ingame]

  1. What do you want to achieve?
    An Animation that works ingame and in the Studio game just like it was animated.

  2. What is the issue?

If I play the Animation, in the Studio-Plugin “Moon Animator” it works just fine,
Ingame however, It just begins to lag.
Every Other Animation is Smooth Instantly, But not this one, It takes up to 4 minutes to Load without Lag.
Since any other Animation is smooth and loads just fine, I don’t know what’s the Issue.

Also 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
-Preloading Animations
-Moving the Scene-Map with the characters Closer to the Player.
-Playing the Animation with weight :Play(1, 1, nil)

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:


Thanks!

2 Likes

Hello? Anyone here?
I have a time limit i need to get it done…
Please help?

1 Like