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
|
  |
| Joined: 30 Nov 2013 |
| Total Posts: 367 |
|
| |
|
|
| 03 Apr 2016 02:21 PM |
http://www.roblox.com/games/146146665/NPC-Animation-Example
#code print('I am very bootiful') |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 03 Apr 2016 02:27 PM |
It's open-source.
#code print('I am very bootiful') |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|