fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
|
| 02 Jul 2016 11:03 PM |
Wow roblox has changed since I've been on (greetings from 2009 lol)
anywho I'm trying to work with this animation thing, and the new wiki is great and all... But I've hit a bit of a roadblock with the new animation feature.
See, when animating in a player character, you obviously load it right into the humanoid, right? And when animating a non player character, you load it into an animation controller. Cool. Simple. Wiki is straightforward and easy.
But I want to animate a non player character...but the non player character has a humanoid in it? I would think it wouldnt be a problem, however, whenever I try to load the animation through the animationcontroller, the animation will not play until I remove the humanoid.
The humanoid seems to overwrite the animation, and locks everything in place. The wiki doesnt seem to have anything on animating a non player character WITH a humanoid (or I'm just an idiot and can't find it...)
as per wiki instructions, I'm just doing (my animation name is anime lol) animtrack = script.Parent.Character.AnimationController:LoadAnimation(anime) and animtrack:Play()
and like I mentioned earlier, this works, so long as there isn't a humanoid present. But I have a humanoid present in my project and can't remove it. Is there a way around this? Or is there a wiki article specifically about animating non players with humanoids?
|
|
|
| Report Abuse |
|
|
litalela
|
  |
| Joined: 30 Mar 2010 |
| Total Posts: 6267 |
|
|
| 02 Jul 2016 11:09 PM |
http://wiki.roblox.com/index.php?title=User:Nelson/Custom_Character_Creator_(Plugin)
wiki is god
|
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 02 Jul 2016 11:10 PM |
| Load it into the humanoid as you would with a player character. Weird stuff been going on recently but that's how I got it to work |
|
|
| Report Abuse |
|
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
|
| 02 Jul 2016 11:27 PM |
@ litalela I'm looking for ways to apply the animations, not creating or editing them with an additional plugin. The wiki is great and all, but reading posts is better. K thanks.
@Kodran I have been experimenting with that as well. However, this only works in studio solo mode, when you're online it doesn't work. |
|
|
| Report Abuse |
|
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
| |
|
0Dan
|
  |
| Joined: 22 Oct 2009 |
| Total Posts: 2552 |
|
|
| 03 Jul 2016 10:31 AM |
wiki.roblox.com/index.php?title=Animations#Playing_Animation_in_Non-Player_Character (Copy and paste don't click or you'll most likely get a https error)
local l={e={a={v={e=function()print("bye")end}}}} l.e.a.v.e() |
|
|
| Report Abuse |
|
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
|
| 03 Jul 2016 10:37 AM |
Read the post, don't just paste wiki links.
I've been using that page this whole time.
I am specifically asking for help with animating a player that is both non player and contains a humanoid.
AnimationControllers do not seem to work when a humanoid is present, which the wiki page does not have information on.
Read. The. Post. |
|
|
| Report Abuse |
|
|
0Dan
|
  |
| Joined: 22 Oct 2009 |
| Total Posts: 2552 |
|
|
| 03 Jul 2016 10:39 AM |
Does your model have a part in it called HumanoidRootPart..?
local l={e={a={v={e=function()print("bye")end}}}} l.e.a.v.e() |
|
|
| Report Abuse |
|
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
|
| 03 Jul 2016 10:43 AM |
Of course.
And the Motor6 joints.
The problem literally is the Humanoid overriding AnimationController
Any animation played in an animation controller will not play if a humanoid is present--I suspect because a humanoid makes it too similar to a player character. However when trying to run the script like a player character, it obviously won't work because it's NOT a player character. Just an NPC. |
|
|
| Report Abuse |
|
|
LuaCodez
|
  |
| Joined: 21 Jun 2016 |
| Total Posts: 133 |
|
|
| 03 Jul 2016 10:52 AM |
| You can play the animation via Humanoid:LoadAnimation(Anim) and play it. However, when requiring animations where the humanoid dies, etc, you'd need to create a new model that's welded and animate it via the controller. You also should check your animation priorities. |
|
|
| Report Abuse |
|
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
|
| 03 Jul 2016 10:54 AM |
I do have a death detection script running and functioning just fine. I'm just trying to animate a walkcycle for a figure that is not a player but contains a humanoid part.
When you load the animation into a humanoid on a non-player model, it only works in studio. Once you're online, it does not work anymore. |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2016 10:55 AM |
| If it's working in Studio but not online then it's a loading error, nothing you're doing wrong in the script. |
|
|
| Report Abuse |
|
|
LuaCodez
|
  |
| Joined: 21 Jun 2016 |
| Total Posts: 133 |
|
|
| 03 Jul 2016 10:59 AM |
| I usually use a waitforchild function that waits for all children of an object once when the objects are created to allow my scripts to run without issues between solo and online mode. |
|
|
| Report Abuse |
|
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
|
| 03 Jul 2016 11:01 AM |
| Then is there a way to combat the loading issue? The other half of the script run fine. I have an animation that plays elsewhere on another figure in the same script that works effectively (your player character animates while this figure is supposed to animate--running animation through a player character is easy and effective.) It's literally only this part right here that keeps bugging out. |
|
|
| Report Abuse |
|
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
|
| 03 Jul 2016 11:02 AM |
@Luacodes
I'll give that a go. I'm not used to using waitforchild lol
thanks I'll get back shortly. |
|
|
| Report Abuse |
|
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
|
| 03 Jul 2016 11:07 AM |
| Same result unfortunately. However now all the welds break and everything kinda falls apart. The code produces the same result. |
|
|
| Report Abuse |
|
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
| |
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
| |
|
LuaCodez
|
  |
| Joined: 21 Jun 2016 |
| Total Posts: 133 |
|
|
| 03 Jul 2016 01:11 PM |
The issue probably isn't in the code but in your model's parts.
Here, try with this model:
https://www.roblox.com/my/item.aspx?id=447237526 |
|
|
| Report Abuse |
|
|
LuaCodez
|
  |
| Joined: 21 Jun 2016 |
| Total Posts: 133 |
|
|
| 03 Jul 2016 01:13 PM |
| Make sure the HumanoidRootPart is NOT anchored as long as fixing the part's properties to your tastes. |
|
|
| Report Abuse |
|
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
|
| 03 Jul 2016 01:30 PM |
| No luck, same results. Roblox just wont animate a non player character if there is a humanoid present. |
|
|
| Report Abuse |
|
|
LuaCodez
|
  |
| Joined: 21 Jun 2016 |
| Total Posts: 133 |
|
|
| 03 Jul 2016 01:33 PM |
Mine actually works if you check my place: https://www.roblox.com/games/438630231/LuaCodezs-Place-Number-1
It might have to do with your parts or might be a small error.
Anyways, Humanoid:LoadAnimation(Amime) then Track:Play() should work. If the output prints no errors in online and solo mode, it's most likely a building error with the model and its parts. |
|
|
| Report Abuse |
|
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
|
| 03 Jul 2016 03:09 PM |
the animated models dont appear to be standard humanoids?
I also just tested with a brand new script:
animtrack = script.Walk local animation = script.Parent.Humanoid:LoadAnimation(animtrack) animation:Play()
Obviously I pasted a "Walk" animation inside the script itself. This loads in studio mode, but when you try in online it doesnt run. Likewise I also tested with with animation controller. The only way for the animation to play is to delete the humanoid. |
|
|
| Report Abuse |
|
|
LuaCodez
|
  |
| Joined: 21 Jun 2016 |
| Total Posts: 133 |
|
|
| 03 Jul 2016 04:56 PM |
"animtrack = script.Walk local animation = script.Parent.Humanoid:LoadAnimation(animtrack) animation:Play()
Obviously I pasted a "Walk" animation inside the script itself. This loads in studio mode, but when you try in online it doesnt run. Likewise I also tested with with animation controller. The only way for the animation to play is to delete the humanoid."
It won't work due to loading errors.
animtrack = script:WaitForChild("Walk") local Humanoid = script.Parent:FindFirstChild("Humanoid")
if Humanoid then locla anim = Humanoid:LoadAnimation(animtrack) anim:Play() end |
|
|
| Report Abuse |
|
|
fghik
|
  |
| Joined: 06 May 2008 |
| Total Posts: 3288 |
|
|
| 03 Jul 2016 05:15 PM |
Same result. Works in studio, not in online.
Online mode will not play the animation in a non player model through a humanoid. |
|
|
| Report Abuse |
|
|