local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local character = player.Character or player.CharacterAdded:Wait()
mouse.Button1Down:Connect(function()
local mousePos = mouse.Hit.Position
local charPos = character.HumanoidRootPart.Position
--make player face the mouse
end)
ive got about this but im not sure what to do from here i want the character to look at the mouse i want it to work so keeping it held will make it face the mouse just how it is in this example video https://gyazo.com/b2d59a7874336fca49d5394860a0b1cd
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local character = player.Character or player.CharacterAdded:Wait()
mouse.Button1Down:Connect(function()
local mousePos = mouse.Hit.Position
local charPos = character.HumanoidRootPart.Position
character.HumanoidRootPart.CFrame = CFrame.lookAt(charPos,mousePos)
end)
Simple solution is to use math, you see there is a thing called Dot and Cross, you can use Dot to determine angle between Front and mousePosition Front is Vector3(0,0,-1) and then use cross to determine which side player should turn, here is tutorial: