So i read that if i used a World Model i could be able to animate characters. So using this i made this script.
The animation is an animation Instance with my own animation i made. However the animation stops as soon as it starts
Like this can someone help me make this play continuously like the arsenal one? I don’t want to use the old method of changing the character each time would rather use this! Thanks
Script
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local ViewPort = script.Parent
wait()
local Camera = Instance.new('Camera')
Camera.Parent = ViewPort
Camera.Name = 'ViewportCamera'
local WorldModel = Instance.new('WorldModel')
WorldModel.Name = 'WorldModel'
WorldModel.Parent = ViewPort
local CharacterViewPort = Character:Clone()
CharacterViewPort.Parent = ViewPort
ViewPort.CurrentCamera = Camera
local PrimaryPart = CharacterViewPort.PrimaryPart
local Size = CharacterViewPort:GetExtentsSize()
local LongestAxisSize = math.max(Size.X, Size.Y, Size.Z)
local Distance = LongestAxisSize * 2
Camera.CFrame = CFrame.new(PrimaryPart.Position + (PrimaryPart.CFrame.LookVector * LongestAxisSize * 1), PrimaryPart.Position)
local Humanoid = CharacterViewPort.Humanoid
local Anim = Humanoid:LoadAnimation(script.Parent.Dancing)
Anim.Looped = true
Anim:Play()