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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Game Design
Home Search
 

Re: NPC Animation Help?

Previous Thread :: Next Thread 
Degreds is not online. Degreds
Joined: 30 Nov 2013
Total Posts: 367
03 Apr 2016 02:18 PM
Does anyone know how to play an animation into an NPC? It only seems to work on Play Solo when I use a humanoid, but it doesn't work at all with an animation controller.

~Deg
Report Abuse
Degreds is not online. Degreds
Joined: 30 Nov 2013
Total Posts: 367
03 Apr 2016 02:19 PM
bump
Report Abuse
iDerpyDogez is not online. iDerpyDogez
Joined: 05 Feb 2012
Total Posts: 1781
03 Apr 2016 02:21 PM
http://www.roblox.com/games/146146665/NPC-Animation-Example


#code print('I am very bootiful')
Report Abuse
Degreds is not online. Degreds
Joined: 30 Nov 2013
Total Posts: 367
03 Apr 2016 02:22 PM
@iDerpyDogez I want to know how to achieve that. Maybe a script example would be helpful?

~Deg
Report Abuse
Degreds is not online. Degreds
Joined: 30 Nov 2013
Total Posts: 367
03 Apr 2016 02:27 PM
Okay, here a server script placed inside of a model:

wait(1)
Dummy = script.Parent
Head = Dummy.Head
Humanoid = Dummy.Humanoid
Controller = Humanoid.AnimationController
IdleAnim = Head.Idle
WalkAnim = Head.Walk
Idle = Controller:LoadAnimation(IdleAnim)
Walk = Controller:LoadAnimation(WalkAnim)

Moving = Dummy.Moving

while true do
if Moving.Value == false then
if Idle.IsPlaying == false then
Idle:Play(0.1)
end
if Walk.IsPlaying == true then
Walk:Stop(0.1)
end
else
if Walk.IsPlaying == false then
Walk:Play(0.1)
end
if Idle.IsPlaying == true then
Idle:Stop(0.1)
end
end
wait()
end

It's loaded from an animation controller just as the wiki said, but it isn't working at all, and only works with a humanoid in play solo, and on a server screen but not from a server player's screen.
~Deg
Report Abuse
iDerpyDogez is not online. iDerpyDogez
Joined: 05 Feb 2012
Total Posts: 1781
03 Apr 2016 02:27 PM
It's open-source.


#code print('I am very bootiful')
Report Abuse
Degreds is not online. Degreds
Joined: 30 Nov 2013
Total Posts: 367
03 Apr 2016 02:30 PM
Oh, well that might help. Sorry for rushing everyone XD
Thanks!

~Deg
Report Abuse
Degreds is not online. Degreds
Joined: 30 Nov 2013
Total Posts: 367
03 Apr 2016 02:45 PM
Alright, I found my error. You're supposed to let the player join/load before starting the animation. Give it around 5 seconds (depending on the client's processor) before creating the animation controller.

~Deg
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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