I’ve been working on a mother ship boss battle for one of my games and I’ve been trying to cframe a turret that is welded to the mothership so that it will face where the player is at the current time when it fires a blast at the player. I wrote this little script below as a demo of what I’ve been trying but I’m not quite sure how I would go about rotating the turret that’s welded with C0. I’ve noticed that the line below “partA.Weld.C0 = CFrame.Angles(math.rad(0), math.rad(0),math.rad(0))” will let me rotate the turret even though it’s still welded to the mothership, like for example if I changed it to “partA.Weld.C0 = CFrame.Angles(math.rad(0), math.rad(50),math.rad(0))” then It would move the welded turret right and negative 50 would turn it left. The issue I have now is, say my variable “detect” is the player, I’d want to make the turret face the direction of that part.but I’m not sure how or what I’d need to do to get the 3 numbers to plug into the angle Cframe. If anyone has any tips or help on how I’d be able to do this that would be great!
local detect = game.Workspace.DetectMe
local partA = script.Parent.Turret1.TurretBase
partA.Weld.C0 = CFrame.Angles(math.rad(0), math.rad(0),math.rad(0))