How could i make it so that this turret look at your mouse but not up or down, only turning around?
Code (local):
local run = game:GetService("RunService")
local mouse = game.Players.LocalPlayer:GetMouse()
run.Heartbeat:Connect(function()
script.Floor.Value.CFrame = CFrame.lookAt(script.Floor.Value.Position,Vector3.new(mouse.Hit.Position.X,mouse.Hit.Position.Y,mouse.Hit.Position.Z))
end)
This post should help for the method, however since itβs not working with C0 you can avoid the relativeToWorld CFrame which is the Part0 CFrame inversed.