How to animate Tool Parts (Guns, Knifes etc.)

When I tried to animate a tool like this, my animation plays but it does not animate the arms and the tool destroys itself after the animation is over. The animation executes with the weapon animating exactly as it would but nothing else animates then is destroyed. My code is almost the same as the example code with the exception that I am handling two motor6Ds. Any idea how I can fix this?

EDIT: The issue was due to cancollide being off for all parts, I had to set the attachment parts that are connected to the torso with their cancollide on but it still doesn’t animate any limbs. I think the server doesn’t properly see it connected to the tool to the character like the client does and that if you have it all on cancollide off, it will fall into the void.

5 Likes

Mind showing some screenshots/gifs of it happeninng? It’s confusing to understand your problem without them.
@Korrow maybe in the future!

3 Likes

Very well explained and very useful. Thank you a lot.

2 Likes

Thanks, would appreciate it! ok

2 Likes

The tool requires a cancollide part since I think the tool falls to the void on the server’s view and completely destroys it while the client sees it as it normally should. While a cancollide part is able to be dealt with, I ideally don’t want to have any cancollide parts.

The biggest issue is the animation not running for any limbs (in my case, I need it to run for the arms). Here is the GIF.

EDIT: Also, if you don’t mind me asking, how would I make an equip animation for the tool? This is meant to be an equipping animation so I do want the last second of the animation to be the player’s animation to hold the sword as well.

4 Likes

Seems that you haven’t code the server part or the RemoteEvent is failing, you have to weld the Motor 6D on both client and server.

2 Likes

Thank you for quickly responding, I realized I made a simple logical mistake during the server part so I did fix the destroying itself issue, however, the unanimated limbs problem remains.

3 Likes

Make sure your animation has higher priority than the default animations! It’s recommended to set tool animations’ priority to the highest, which is Action.

3 Likes

Forgot to mention this but the animation is already on Action. The animation does run after all, its just the arms not animating.

2 Likes

I found out that it was due to using the wrong rig type! Sorry for such a simple mistake but at least it might help others who have my problem if they don’t know about this.

2 Likes

Can you do a tutorial or help me on how your arm moves up and down whenever your mouse moves up and down?

Tsym I love this tutorial as it is explained very well and easy to understand! :smile:

1 Like

In your last video of the M16 being pointed at the mouse whilst in first person Im wondering which method did you use to execute that, I know how to do the rotation and such I just don’t know the best way to perform it such as changing C0/C1 on each of the Motor6ds

2 Likes

So thrilled to have run across this excellent tutorial. Thank you for taking the time to write it up. I’m working on a skateboarding game using animations instead of a traditional rolling board. I’ve been able to get it working very well, and have animated several tricks, but I have the board completely attached to one foot, so I’ve not been able to animate any tricks where the board separates from that one foot (kickflip for example). I think this is the solution!

2 Likes

This was super helpful!
The unidentified variables confused me for a moment but I manged to get this to work within a couple of minutes. I’ve always wanted to know how to do this, thanks man.

1 Like

It works but when i equip the tool, there’s a split second where tool is offsetted in it’s original position which makes it look unnatural.

You can see how there’s a slight delay in the motor being added, in that short amount of time, the tool is at its default position when i started animating it
https://gyazo.com/8ee78ffbde4100f49a9f6792cbbcbd5b

This is how it looks like when i attached a Motor6D to the RightHand and connect it to the tool’s Grip. I didn’t rotate it or anything because if i did, i’d have to rotate it in the exact same position every time i want to animate
https://gyazo.com/cf222c3674e194f25bdf16173e0ec655

Also, i have all the animations done for it already and i can’t change its default position when animating or else all animations will change.

1 Like

Maybe it’s because the previous OnServerEvent was still on-going and it happens if you re-equip too fast. I’ll update the code sample to prevent that in the future if I have time.

You can also spend some time to make an equip animation!

2 Likes

I came up with a temporary fix which is to make the tool invisible for 0.1 second and set it back to visible. It seems somewhat impractical but it works for the time being.

1 Like

Whenever I connect the Motor6D to my BodyAttach, the gun flips upside down.

1 Like

I still have some things a bit off but otherwise looking good! I can use this for future reference now.
SwordTest

5 Likes