Animation isnt working when I change the player's character to another one

I’m trying to recreate a game somewhat like Iron Man simulator but with the moves I want and I just finished the call suit function and when I morph into the suit the suit doesnt have any animations. If there is any better way to do this I would appreciate any suggestions.

local ReplicatedStorage = game.ReplicatedStorage
local Assets = ReplicatedStorage.Assets

local TweenService = game:GetService("TweenService")

local EquipTime = 1

return function(Char:Model,Suit:string)
	if Char then
		local AnimationModule = require(Char.Core.Animations)
		local ChosenSuit = nil
		for Index,Value in game.ReplicatedStorage.Assets.Suits:GetChildren() do
			if string.lower(Value.Name) == Suit then
				ChosenSuit = Value
				break
			end
		end
		if ChosenSuit then
			local SuitClone : Model = ChosenSuit:Clone()
			SuitClone.Parent = workspace.Suits
			
			TweenService:Create(SuitClone.PrimaryPart,TweenInfo.new(1),{CFrame = Char.PrimaryPart.CFrame * CFrame.new(0,5,2.5)}):Play()
			task.wait(1)
			TweenService:Create(SuitClone.PrimaryPart,TweenInfo.new(1),{CFrame = Char.PrimaryPart.CFrame * CFrame.new(0,0,2.5)}):Play()
			task.wait(1)
			AnimationModule.Animations["SuitUp"]:Play()
			
			local CharHum : Humanoid = Char.Humanoid
			local Player = game.Players:GetPlayerFromCharacter(Char)
			
			local Hum : Humanoid = SuitClone:WaitForChild("Humanoid")
			local Animator : Animator = Hum:WaitForChild("Animator")
			local SuitHrp : Part = SuitClone.PrimaryPart
			
			local Animation : AnimationTrack = Animator:LoadAnimation(Assets.Animations.SuitUp)
			Animation:Play()
			Assets.Remotes.LockPlayer:FireClient(Player,Animation.Length+EquipTime*2,true)
			task.wait(EquipTime)
			local Tween = TweenService:Create(SuitHrp,TweenInfo.new(EquipTime),{CFrame = Char.PrimaryPart.CFrame})
			Tween:Play()
			task.wait()
			Tween.Completed:Once(function()
				for _,object : Instance in SuitClone:GetChildren() do
					if object:IsA("BasePart") or object:IsA("MeshPart") then
						object:SetNetworkOwner(Player)
					end
				end
				Player.Character = SuitClone
				Assets.Remotes.LockPlayer:FireClient(Player,0,false,SuitClone)
			end)
		end
	end
end
1 Like

Excuse me not good at animation. If there is a script for animation, the default animation is off. Do you have such a script?
This page may help you

The animations work if I put the morph into startercharacters but it doesnt work when I change the player’s character into it

If there is a script for animation, please show me it. Also, please tell me if the script you firstly showed was done in server side, or client side?

You need play animation in script-client, not in script-server

basically client can also replicate animations (but they do have limitations)

What’s a script-client? Like a remote event connecting it or?

No..

you just play animation inside model that you posted image in post