Adding a spinning object onto a animated rig

So I encounter a problem when making a minigunner tower for my game. I want to make the gun spin while the tower play the animation but it doesnt seem to work correctly. I tried the most simple thing like CylindricalConstraint to stuff like tween but none of them work when connected to an animated rig like this. Does anyone know how to fix this? (note that the animation itself doesnt include spinning barrel, only the body and handle)

I am not exactly sure, but I believe you could utilize a Motor6D and use Tween or CFrame to manipulate the barrel to spin. Since Motor6D is also animatable, you could possibly use :Transform() as well in order to manipulate it.

1 Like

Why can’t you just animate it though?

Yeah that’s the code and it’s not working script
That you have to be to fix your game I think so I’m not sure but by the way this is a new Testaments

Animating barrel rotation is an unnecessary amount of work. You will need to animate it slowly starting to spin up and then constantly rotating. It is much easier to do this via scripting as you can control the speeds.

Use fadetime, and it really isn’t that hard…

1 Like

The person might want to vary the speed depending on different factors. I am no professional with animations, but I know that when there is inconsistent variation, it is much better to use scripts rather than manually animating. That is why gun sway is usually scripted rather than animated, as well as recoil. I guess he could use a looped animation and change the animation speed, but if he wants the rotation of the barrel to be dethatched from the previous animation, then he’ll be running two animations. Another problem might be rotation variation. If the speed of the rotation changes constantly, then I think that it is much better to use a script instead. You do have a point, but I am just providing an answer to the programming way of solving this problem.

1 Like