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: Animations not Working?

Previous Thread :: Next Thread 
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
17 Aug 2016 05:09 PM
Hi, i have a combat system where if you cast a spell, an animation plays. This is all in a local script but the problem is that the animation isn't working outside of studio. In studio, it works fine! I don't really know what the problem is besides the fact that there is an error that says something along the lines of "Animation failed to load"

local Humanoid = char.Humanoid
local animation = Instance.new("Animation", script.Parent)
animation.AnimationId = "http://www.roblox.com/Asset?ID=480874563"
local animTrack = Humanoid:LoadAnimation(animation)
animTrack:Play()

thanks
Report Abuse
not_luxio is not online. not_luxio
Joined: 13 Jul 2016
Total Posts: 178
17 Aug 2016 05:12 PM
Post:
1. The line that sets the definition of "char"
2. What script.Parent is set to
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
17 Aug 2016 05:16 PM
char = plr.Character

I updated the code,

local Humanoid = char.Humanoid
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=480874563"
local animTrack = Humanoid:LoadAnimation(animation)
animTrack:Play()
Report Abuse
not_luxio is not online. not_luxio
Joined: 13 Jul 2016
Total Posts: 178
17 Aug 2016 05:17 PM
set the parent of Animation to workspace, or some folder in workspace, see if that works
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
17 Aug 2016 05:24 PM
if not workspace:FindFirstChild("Cast") then
animation = Instance.new("Animation", workspace)
animation.Name = "Cast"
else
animation = workspace.Cast
end

animation.AnimationId = "http://www.roblox.com/Asset?ID=480874563"
local animTrack = Humanoid:LoadAnimation(animation)
animTrack:Play()

Still not working. I got an error

"Animation failed to load: workspace.Cast"
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
17 Aug 2016 05:37 PM
Okay i tried putting an animation object in the script with the animationid and all. Heres the code.

Does roblox have to approve each animation? Should it take this long? Also, do i need to subtract one from the anim id or something?

local AbScript = ability:Clone()
anim = nil

if AbScript:FindFirstChild("Cast") then
anim = AbScript.Cast
end

if anim ~= nil then
local animTrack = Humanoid:LoadAnimation(anim)
animTrack:Play()
end
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
18 Aug 2016 06:35 PM
B1
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
18 Aug 2016 06:36 PM
wait(10)
--load animation
animTrick:Play()

there you go fixed
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
18 Aug 2016 06:37 PM
Hah. No. I need it to play instantly.
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
18 Aug 2016 06:44 PM
my method works

you cant expect to load something before people are even in the game to load it

server loads everything before clients can connect

load it after a client is fully connected

'hah no' yourself
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
18 Aug 2016 06:45 PM
Thank you for the suggestion though.
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
18 Aug 2016 06:46 PM
Listen, i don't want it to wait 10 seconds before it can play. it doesn't even load the animation until the player spawns from the 30 second intro.
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
18 Aug 2016 06:47 PM
"LOAD IT AFTER THE CLIENT HAS FULLY LOADED"

Also you need to use animations from your group if it is a group game
animations from your group or yourself when it is your own
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
18 Aug 2016 06:50 PM
So what your saying is do

animTrack = humanoid:LoadAnimation(game.ReplicatedStorage.Animation)

wait(10)

animTrack.Play()



?Que?
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
18 Aug 2016 07:00 PM
no

you loaded it before the client has loaded

while #game.Players:GetPlayers() < 1 do
wait()
end

wait(1.6)

--load and play
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
18 Aug 2016 10:08 PM
Okay. I have a folder in workspace titled animations and an animation inside it.

The cast animation works in studio, but not the game!

I tried loading it first, adding a wait. nothing seems to work.
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
19 Aug 2016 04:19 PM
bump
Report Abuse
TilloFernandez is not online. TilloFernandez
Joined: 21 Mar 2015
Total Posts: 273
19 Aug 2016 04:21 PM
If you want an animation to play for everyone, and filtering is enabled, you need to use Remote Events. Check the Wiki.


~ The Lonely Developer
Report Abuse
LifeInDevelopment is not online. LifeInDevelopment
Joined: 10 Nov 2015
Total Posts: 670
19 Aug 2016 04:22 PM
I tried this with shirts, I don't know if it works with animations but if you copy and paste in the id by itself into the id property in the properties panel then it might automatically change it to the correct animation id, then copy and paste. If that doesn't work then just keep on subtracting 1 until it works.
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
19 Aug 2016 04:22 PM
filtering isnt enabled. I want a player to play an animation when they cast a spell.
Report Abuse
TilloFernandez is not online. TilloFernandez
Joined: 21 Mar 2015
Total Posts: 273
19 Aug 2016 04:22 PM
Also, try using:
rbxassetid://480874563
Instead of the link.


~ The Lonely Developer
Report Abuse
TilloFernandez is not online. TilloFernandez
Joined: 21 Mar 2015
Total Posts: 273
19 Aug 2016 04:24 PM
Also, if you're using an animation from another player, it won't work. Roblox prevents stealing animations.


~ The Lonely Developer
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
19 Aug 2016 04:27 PM
@life

Thanks for your input, but it doesn't seem to be working ;(
Report Abuse
frriend is not online. frriend
Joined: 07 Feb 2010
Total Posts: 577
19 Aug 2016 04:28 PM
@tillo

The animation is on my profile and loads in studio without any errors.

In game, i get an error saying workspace.Animations.Cast Failed to load.
Report Abuse
TilloFernandez is not online. TilloFernandez
Joined: 21 Mar 2015
Total Posts: 273
19 Aug 2016 04:30 PM
Seems like a Roblox issue. #LostCause


~ The Lonely Developer
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