You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? Keep it simple and clear!
I just want one of my CFrames to look at the other.
What is the issue? Include screenshots / videos if possible!
This is a client script by the way)
The basepart is not looking at the camera. Originally, I was just setting the CFrame without bodygyros because it didn’t seem like there was a need.
but when I used the character’s baseparts I needed to use bodygyros to make it smooth and work properly because the turning was working but it would be laggy and teleport the player back and forth.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried setting networkownership to the player, that hasn’t worked.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- Local script
local BodyGyro = Instance.new("BodyGyro", Head)
Mouse.Button2Down:Connect(function()
RightMouseHeld = true
while RightMouseHeld == true do
-- The cframe is not looking at the other
BodyGyro.CFrame = CFrame.lookAt(-Head.CFrame.Position, -Camera.CFrame.Position)
task.wait()
end
end)
Mouse.Button2Up:Connect(function()
RightMouseHeld = false
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
if the character is the local player character it should work fine from a local script, i tested this local script in startercharacterscripts and it works
local bg = Instance.new("BodyGyro")
bg.Parent = game.Players.LocalPlayer.Character:WaitForChild("Head")
bg.MaxTorque = Vector3.new(1000000,1000000,1000000)
while task.wait() do
bg.CFrame = CFrame.lookAt(game.Players.LocalPlayer.Character.Head.Position, workspace.CurrentCamera.CFrame.Position)
end
however even though this is in a local script it will be visible to other players in the server as any physics done by a player on their character is replicated to the server
I am so sorry! Your answer was technically correct, I didn’t realise I had the basepart anchored and this caused the part to not move! I’m sorry my code was very long that I didn’t notice. So I will technically mark you down as the solution. Thanks for the help.