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 » Scripting Helpers
Home Search
 

Re: How do I load an Animation onto a non-player character?

Previous Thread :: Next Thread 
Boopbot is not online. Boopbot
Joined: 11 Jul 2008
Total Posts: 2284
21 Oct 2014 09:43 PM
I first tried it with just loading it onto a humanoid object, and that worked, but only in Edit mode. Once I ran a test server it wouldn't start the animation, but it said in the output that it was reaching different keyframes.

Next I looked at the wiki and loaded the animation onto an AnimationController, and the same thing happened, it showed that it was reaching keyframes but the guy wasn't moving.

Is there a good script for NPC animation that I can look at?
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
21 Oct 2014 09:51 PM
You should be able to do it with the humanoid, there are some bugs with running animations on the server that resurface from time to time

guise i have a siggy
Report Abuse
Boopbot is not online. Boopbot
Joined: 11 Jul 2008
Total Posts: 2284
21 Oct 2014 09:56 PM
Alright then...
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
21 Oct 2014 10:16 PM
function runAnim(npc,id)
local anim = Instance.new'Animation';
anim.AnimationId = id;
local controller = Instance.new('AnimationController',npc);
local track = controller:LoadAnimation(anim);
anim:Play();
track:Destroy();
end;

runAnim(game.Workspace.NPC,'rbxassetid://1');
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
21 Oct 2014 10:17 PM
whoops:

function runAnim(npc,id)
xpcall(function() npc['AnimationController']:Destroy'' end, function return 'Error: 'end);
local anim = Instance.new'Animation';
anim.AnimationId = id;
local controller = Instance.new('AnimationController',npc);
local track = controller:LoadAnimation(anim);
track:Play();
end;

runAnim(game.Workspace.NPC,'rbxassetid://1');
Report Abuse
DeviousDeviation is not online. DeviousDeviation
Joined: 28 Dec 2010
Total Posts: 9306
21 Oct 2014 10:19 PM
kpt, there's no need to overcomplicate things, it's just a bug on roblox's end.

guise i have a siggy
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
21 Oct 2014 10:20 PM
'Is there a good script for NPC animation that I can look at?';
Also, I'm not over-complicating things. Do you think he would rather have nothing or something.
No offense intended. :)


semicolons are love, semicolons are life
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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