Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Unable to cast value to Object, Anyone can help me?

I'm kind of new to LUA language, But I can't figure out why this code:

local animation = script:WaitForChild('Animation')

local humanoid = script.Parent:WaitForChild('Humanoid')

local Anim = humanoid:LoadAnimation('Animation') 

would give me that error... Help?

1 answer

I think i have fixed those errors

Go read some of the learn roblox tutorials on the dev hub :)

local animation = script:WaitForChild('Animation')

local humanoid = script.Parent:WaitForChild('Humanoid')

local Anim = humanoid:LoadAnimation(animation) -- You did 'Animation' instead of animation, your problem is now fixed!


Also, put your code in a code block like this:

Step 1: Click "Code block" up at the top. THIS WILL CREATE A CODE BLOCK AT WHERE YOU ARE TYPING! Make sure to watch out! https://gyazo.com/a43a2507e62b9f335d16460da0175b0f

Step 2: Copy and paste code into the code block. https://gyazo.com/29bc2b9b117fb64b956db60170df7fcf

6 comments

0

Thanks man, I really appreciate your help :)

0

Can you hit "Accept Answer" below my answer? It would help me a lot!

0

WHAT

0

its not there

This discussion is preserved as it was. New answers, comments, and votes are closed.