Hey I was working on a small project and in the project I needed to turn the player to face the mouse. I saw that I could do this using BodyGyro but it was too slow so I went the CFrame route.~~~~~~~~~~~~~~~~~ function turn(mouse) local pointto = mouse.Origin local rotation = nil
local player = script.Parent.Parent while true do
--print(rotation) rotation = pointto - mouse.Origin.p wait(1) player.UpperTorso.CFrame = rotation + player.UpperTorso.CFrame.p + Vector3.new(0,1,0) end end ~~~~~~~~~~~~~~~~~ The turn fuction rotates the player on the Y axis only to face the mouse; well that is what it should do. Can someone tell me why the player is moving forward in a jerky manner and why the player only faces the mouse upon function call and no other time?
Also, what are the benefits and disadvantages of using BodyGyro and CFrame for this sort of task. I am aiming to make the turn swiftly but not choppily. Are there any other methods of doing this task? Thanks