#How to make character facing to mouse

1 messages · Page 1 of 1 (latest)

dense lantern
#

i really dont understand how to make that character facing position gonna be replicated to server that can everyone see

wide nacelle
#

meaning if you move your character on your client then it gets replicated to the server

#

and not the other way round

dense lantern
wide nacelle
#

yup

dense lantern
#

can you tell me then why this works only for me

game.ReplicatedStorage.OneButton.OnClientEvent:Connect(function(bool)
    local cycle
    if bool then

        local plr = game.Players.LocalPlayer
        local mouse = plr:GetMouse()
        local char = plr.Character or plr.CharacterAdded:Wait()
        local hrt: Part = char:WaitForChild("HumanoidRootPart")
        cycle = game["Run Service"].RenderStepped:Connect(function()
            local hitpos = mouse.Hit.Position
            hrt.CFrame = CFrame.new(hrt.Position, hitpos)
        end)

    end

    if not bool then 

        cycle:Disconnect()

    end

end)
wide nacelle
#

idk

#

should work

#

what do the other players see

dense lantern
#

maybe this wont work cus im doing local server test?

wide nacelle
#

it should work

wide nacelle
dense lantern
#

without even spinning

#

i just tested this in global server with my friend and this still doesnt work