Hello,
I am coding a game about the future and I created a character in blender (and no from Roblox), so when I am creating an animation it looks:
My game is published with my group and my animations as well.
But I am getting some problem : the animations are not loading, the character is in the basic position (when I created it) :
The script when I am deploying with my custom character :
local rs = game:GetService("ReplicatedStorage")
local event = rs.Events.Deploy.DeployEvent
event.OnServerEvent:Connect(function(plr)
local GunChoosed = plr.GunChoosed
local newCharacter = game:GetService("ReplicatedFirst").Morphs.Character:Clone()
local newAnimate = game:GetService("ReplicatedFirst").Morphs.ManagerAnimations:Clone()
newAnimate.Name = "Animate"
local char = plr.Character
newCharacter.Name = plr.Name
newCharacter:PivotTo(char.HumanoidRootPart.CFrame)
char:Destroy()
plr.Character = newCharacter
newCharacter.Parent = workspace
newAnimate.Parent = newCharacter
wait(0.5)
local humanoid = newCharacter.Humanoid
event:FireClient(plr, humanoid)
end)
The script which manage animations :
local plr = game:GetService("Players").LocalPlayer
local character = script.Parent
local humanoid = character:FindFirstChild("Humanoid")
local function loadanimation(anim)
return humanoid.Animator:LoadAnimation(anim)
end
if (humanoid) then
local walkAnim = script:WaitForChild("March")
local walkAnimTrack = loadanimation(walkAnim)
local pauseAnim = script:WaitForChild("Pause")
local pauseAnimTrack = loadanimation(pauseAnim)
humanoid.Running:Connect(function(speed)
if speed > 0 and speed < 17 then
-- Stop
if pauseAnimTrack.IsPlaying then
pauseAnimTrack:Stop()
end
-- Playing
if not walkAnimTrack.IsPlaying then
walkAnimTrack:Play()
end
else
if walkAnimTrack.IsPlaying then
walkAnimTrack:Stop()
end
if not pauseAnimTrack.IsPlaying then
--pauseAnimTrack:Play()
end
end
end)
end
The content of the character :
By the way I tried to test it in the normal roblox and no in the studio, it did not work.
Finally, I have no error.