Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Custom default Animations Won't Work In-Game but they do work in studio. Any help?

Asked by 5 years ago

I'm trying to change the default animations for my game. I took the anima script out of my character and stuck it into StarterCharacterScripts. I changed the id for the walking and running animation in the script as well as in the string values into rbxassetid://2718435884. In studio it works smoothly, my character has the anima script. But when I enter the game the animations don't work and I just stand still. when i press f9 it says 09:38:48 -- CoreGui.RobloxGui.Connection:343: attempt to index upvalue 'errorPrompt' (a nil value) Stack Begin Script 'CoreGui.RobloxGui.Connection', Line 343 Stack End 09:38:55 -- Animation "http://www.roblox.com//asset/id=2718435884&serverplaceid=2718226858" failed to load in "run.AnimationId" : Animation failed to load. And in the server log it says: 09:39:23 -- Model:GetPrimaryCFrame() failed because no PrimaryPart has been set, or the PrimaryPart no longer exists. Please set Model.PrimaryPart before using this. 09:39:23 -- A primary part should be set so that the character can be spawned correctly 09:39:30 -- Animation "https://www.roblox.com//asset/?id=2718435884&serverplaceid=2718226858" failed to load in "Animation.AnimationId" : Animation failed to load

Here is the script up to the part i changed:

local Character = script.Parent local Humanoid = Character:WaitForChild("Humanoid") local pose = "Standing"

local userNoUpdateOnLoopSuccess, userNoUpdateOnLoopValue = pcall(function() return UserSettings():IsUserFeatureEnabled("UserNoUpdateOnLoop") end) local userNoUpdateOnLoop = userNoUpdateOnLoopSuccess and userNoUpdateOnLoopValue local userAnimationSpeedDampeningSuccess, userAnimationSpeedDampeningValue = pcall(function() return UserSettings():IsUserFeatureEnabled("UserAnimationSpeedDampening") end) local userAnimationSpeedDampening = userAnimationSpeedDampeningSuccess and userAnimationSpeedDampeningValue

local AnimationSpeedDampeningObject = script:FindFirstChild("ScaleDampeningPercent")

local currentAnim = "" local currentAnimInstance = nil local currentAnimTrack = nil local currentAnimKeyframeHandler = nil local currentAnimSpeed = 1.0

local runAnimTrack = nil local runAnimKeyframeHandler = nil

local animTable = {} local animNames = { idle = {
{ id = "http://www.roblox.com/asset/?id=507766666", weight = 1 }, { id = "http://www.roblox.com/asset/?id=507766951", weight = 1 }, { id = "http://www.roblox.com/asset/?id=507766388", weight = 9 } }, walk = {
{ id = "rbxassetid://2718435884", weight = 10 } }, run = { { id = "rbxassetid://2718435884", weight = 10 } }, swim = { { id = "http://www.roblox.com/asset/?id=507784897", weight = 10 } }, swimidle = { { id = "http://www.roblox.com/asset/?id=507785072", weight = 10 } }, jump = { { id = "http://www.roblox.com/asset/?id=507765000", weight = 10 } }, fall = { { id = "http://www.roblox.com/asset/?id=507767968", weight = 10 } }, climb = { { id = "http://www.roblox.com/asset/?id=507765644", weight = 10 } }, sit = { { id = "http://www.roblox.com/asset/?id=2506281703", weight = 10 } },
toolnone = { { id = "http://www.roblox.com/asset/?id=507768375", weight = 10 } }, toolslash = { { id = "http://www.roblox.com/asset/?id=522635514", weight = 10 } }, toollunge = { { id = "http://www.roblox.com/asset/?id=522638767", weight = 10 } }, wave = { { id = "http://www.roblox.com/asset/?id=507770239", weight = 10 } }, point = { { id = "http://www.roblox.com/asset/?id=507770453", weight = 10 } }, dance = { { id = "http://www.roblox.com/asset/?id=507771019", weight = 10 }, { id = "http://www.roblox.com/asset/?id=507771955", weight = 10 }, { id = "http://www.roblox.com/asset/?id=507772104", weight = 10 } }, dance2 = { { id = "http://www.roblox.com/asset/?id=507776043", weight = 10 }, { id = "http://www.roblox.com/asset/?id=507776720", weight = 10 }, { id = "http://www.roblox.com/asset/?id=507776879", weight = 10 } }, dance3 = { { id = "http://www.roblox.com/asset/?id=507777268", weight = 10 }, { id = "http://www.roblox.com/asset/?id=507777451", weight = 10 }, { id = "http://www.roblox.com/asset/?id=507777623", weight = 10 } }, laugh = { { id = "http://www.roblox.com/asset/?id=507770818", weight = 10 } }, cheer = { { id = "http://www.roblox.com/asset/?id=507770677", weight = 10 } }, }

0
Put the code in Lua properly, please. ScrubSadmir 200 — 5y

Answer this question