(i apologize if this is in the wrong area, i didn’t see an animation specific area, and scripting may or may not be a part of the issue)
Hey all, working on a project, and we made a custom rig for our tool, and when we created animations, we posed the Handle that was part of the rig, like this (this is one example, but the Handle does not animate properly on all of our animations):
however, in game, the animation comes out like this:
When i made the rig, i copied the sword exactly from the script, down to the welds.
i’ve been looking into this for the better part of a week, i’ve re-rigged it, i’ve re-coded things about twice, thinking maybe it was my implementation that was the issue, but so far no fixes.
any animation experts able to tell me whats wrong? willing to provide any extra information if needed.
if you have moon animator and you haven’t already, use the easy weld moon animator gives you. From the looks of it though, you dont have it. Did you use Motor6Ds for the sword? or did you use normal Welds? if you used normal Welds, use motor6ds, and if you used motor6ds, try using welds.
To my knowledge, you cannot use weld constraints when animating to change the “grip” of a weapon. I have used a similar approach to changing the grip of a weapon, and I found that creating a Motor6D joint between the hand and the tool works well.
If you have any questions on how to create a Motor6D between the tool and your character, or anything else, let me know.
Edit: For sake of simplicity, I’ve gone ahead an made an example rig that you can insert into your game to see how I’ve gone about attaching the weapon to the character. This is compatible with Moon Animator 2. ExampleRig.rbxm (28.9 KB)
Hey! Thanks for the example! my turns out a lot of them are backwards. this fixes the rig, but the same problem seems to persist when trying to play the animation. i think our custom animations might be overlapping and causing some overrides… will go back to testing that, though
I had created an animation to test it with, and I made the Handle visible so i can see if it just wasn’t put together right, but the Handle still doesn’t move.
I see what you mean. When exporting these animations make sure that you are setting the “AnimationPriority” value of the Animation, as that could be the cause of your overlapping issue. Make sure that animations that you want to have higher priority are set to “Action” or above, while Idle animations and movement get a lower priority.
Here’s a development document outlining Animation priority. Let me know if this fixes your issue.
I went back into the Animation, set the animation type to “Action” within Moon2, and then re-uploaded it.
for simplicity, i also disabled everything else that changes or plays animations. basically nothing changed.
in this gif, i am pressing a button to make the animation happen, which is supposed to just rotate the Handle and change its position. it is static.
I can confirm that the rig works fine on my end. I’m sure it’s a programming issue. When loading and playing an animation, be sure to also read and set the animation priority.
is that something i’m able to do in code? if so, i didnt realize you could grab that info in the script. that might help when i go to re-write the code in the morning.
Well, thank you for your time anyway! i at least learned how to make a better rig with your help!
Animation Weight? i hadn’t heard about roblox using that before. when did this get put in?
did a cursory google search, and gave it a quick test, but setting the weight to 10 still does not move the weapon in my characters hand. the only things that seem to move is the character itself…
Yep! they are motor6Ds. If you’d like to check the rig out, i uploaded an rbxm file with just the rig earlier in the thread. Its the exact same as the one in the tool.