How do i make a tank turret rotate?

Hello, so my problem is im trying to make a tank ai system but i dont know how to rotate the turret to a target part so it can shoot in the direction of another tank. Keep in mind that i want the turret meshpart to only rotate left and right and the gun meshpart rotates up and down so that means i think that i need a weld constraint or something to connect them.

I have no idea what to rotate the turret like i mentioned maybe i should use some sort of constraint or something?
I appreciate any help
thanks!

2 Likes

There are a lot of resources for this but not specifically for tank turrets. At the core, this question can be summed up as ā€œHow to rotate a part towards another partā€ with the exceptions of the mesh parts rotations. Check this thread out, itā€™ll give a decent start:

1 Like

But I want to rotate a part with a specific speed

Speed can be applied to this, I would really want you to read the thread or the docs on Tweens and CFrames.