So, I’ve been working with a particular project for some time, and every once in a while I have the issue of my animations not working properly. I have a system where you can hit a character and that character will ragdoll, but what’s happening is that the character is deactivated and the ragdoll instance is enabled. After some time, the character will respawn, reactivate, but when that happens, I can’t rotate my character and/or my character gets stuck in an awkward pose. I know it’s due to the animator because I’ve been making override controllers to play different animations, so after implementing an override controller, these problems occurred.
Things I’ve tried:
created a script that would destroy the animator onDisable and recreate it onEnable to see if I could reset it.
tried messing with culling mode, update mode, and root motion, all of which resulted the same.
Things to note:
the animator and rigidbody is on the same object, not sure if that will affect anything.
all movement and control is rigidbody based, I do add force in animation events like dashing forward.
I’m currently working with UMotion to make my animations, all of which are generic.
the model is an fbx model from blender.
settings for the animator
root motion: off
update mode: normal
culling mode: cull updates transforms
I don’t know if this belongs in the animation category or the physics category, but I’m fairly certain that the animator is interfering with my physics in some way. I should also note that I’m still learning on the animation side of things so I could’ve missed something in terms of how to implement it. I have other animator controllers that work the way they’re supposed to, It’s just a couple that just don’t like to work. It’s happening after the character is disabled and then re-enabled, in which I’ll have motion issues or my animations get stuck in a pose. Any help would be much appreciated, thank you.
I prefer to have the model with the Animator as a child of the Rigidbody so that you can always swap out the model without affecting anything else, but I don’t think that would be the cause of your issue.
It has been a while since I looked into it so I can’t remember the specifics, but I know that Animator Controllers have a bunch of issues with being reactivated which do not occur in Animancer instead (link in my signature).
Thanks for the response! I ended up temporarily fixing the issue, but I have been having issues with the Animator Controllers. I do like the idea of Animancer, I originally came from gamemaker, where you didn’t have a controller, you just assigned an animation, It would be a lot easier for me to work with that type of style. Thanks for letting me know about it, I’ll be looking into that, for sure!
Hi maizinblu, I happen to be online at the moment, I’ll see if I can help.
Your question is kind of hard to understand. Are you trying to access a rigidbody from another object’s script? Or are you trying to, in a sense, copy a rigidbody to another?
Specifically, when I add an animation or edit an existing animation in the controller, my movement script stops working. I’ve read that creating an empty object with a rigidbody component then placing my object with script and animations into that empy object as child. My question is this: where does the script reside and how does it effect the child?
Well, in the projects I’ve created, I mainly have everything in one object, so the Animator, Rigidbody, and Movement script that I have setup are inside the same object. Regarding creating a child object of a Rigidbody and storing your Animator and Movement script there, I’ve read that too, but I haven’t necessarily experienced a difference in either situation. Troubleshooting animator issues tends to be problematic, but, in my experience, it usually comes down to how the script works.
To your other question, your script shouldn’t effect your child unless you specifically ask it to. If you effect the Rigidbody, the Rigidbody itself effects all the children within that object, that’s something to note. I can’t really help a great deal because there’s not a lot of information to work on here. Have you made a post about it in the scripting forum? You’ll likely get some better answers there, but I would give some more detail on the matter, like showing what you have in your movement script.
I know this thread is pretty old, but I was having the same issue and the fix was extremely simple and I didn’t see it posted already. Just disable the “Apply Root Motion” option in the animator, and the physics should work as intended. Hope this helps