generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Unable to cast value to Object

Previous Thread :: Next Thread 
ShwerpyDew is not online. ShwerpyDew
Joined: 18 Apr 2010
Total Posts: 219
13 Apr 2016 06:18 PM
while true do
local animController = Instance.new("AnimationController")
local animTrack = animController:LoadAnimation("http://www.roblox.com/asset/?id=251452633")
animTrack:Play()
wait(5)
end

The output says 'Unable to cast value to Object' on line 3.
This is a server script inside of a player, I made the loop so I could see if it was working or not
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
13 Apr 2016 06:20 PM
You need to give it an Animation object, not a link to an asset
Report Abuse
ShwerpyDew is not online. ShwerpyDew
Joined: 18 Apr 2010
Total Posts: 219
13 Apr 2016 07:16 PM
while true do
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=251452633"
local animController = Instance.new("AnimationController")
local animTrack = animController:LoadAnimation(animation)
animTrack:Play()
wait(1)
end

Now it displays the error 'Object must be in Workspace before loading animation.'
WHAT
Report Abuse
Flux_Capacitor is not online. Flux_Capacitor
Joined: 07 Apr 2008
Total Posts: 45720
13 Apr 2016 08:11 PM
The error is self-explanitory. Also it's a bad idea to keep creating them, just create it outside the loop and play it inside the loop
Report Abuse
ShwerpyDew is not online. ShwerpyDew
Joined: 18 Apr 2010
Total Posts: 219
13 Apr 2016 11:21 PM
Oh I see, thanks!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image