Player look mouse Direction

Make the player look in the direction of the mouse without delay.

I wanted a method to make the character look towards the mouse without the delay of remote events and all players can see.

I already tried a loop sending remote events with the mouse position and then changing the CFrame of the humanoidrootpart but this method has a delay for the character to look towards the mouse.

Sorry if I did something wrong as this is my first post here on the forum

Basically like Shift Lock, right? Would like to know before I draft a reply :slight_smile:

basically yes but something more like the character looking in a direction before using an ability

If you wanted, you can do exactly what you did before, but without the RemoteEvents.

You can change the character’s CFrame from the client without any problems, it does not need to be from the server.

hm, I didn’t know you could change things like cframe on the client side, thx for the help

As has been suggested, this can all be handled locally as the client has network ownership (control) over their player’s character model’s replication.

local tweens = game:GetService("TweenService")
local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local hrp = character:WaitForChild("HumanoidRootPart")

local mouse = player:GetMouse()

mouse.Move:Connect(function()
	local tween = tweens:Create(hrp, TweenInfo.new(0.15, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CFrame = CFrame.lookAt(hrp.Position, Vector3.new(mouse.Hit.Position.X, hrp.Position.Y, mouse.Hit.Position.Z))})
	tween:Play()	
end)

This animates the character’s movement such that it faces the position of the mouse’s cursor in the world space.