#Mouse Tracking to server replicator

1 messages · Page 1 of 1 (latest)

karmic fjord
#

How do i get the player following their mouse to the server so other players can see it? (tried events laggy + jitter) need HELP !

slate crater
#

If it's a part following their mouse then you can give them network ownership of the part and do control from client

karmic fjord
slate crater
#

why do u need to use remote event for that

karmic fjord
# slate crater uh

idk 😭🙏🏼 other clients couldnt see it so i thought send an update to the server every few frames would work (it DID NOT) hopefully this network solution works

slate crater
#

moving their own character

#

they already have network ownership so u should be able to move them on client

karmic fjord
#

still not working only the player rotating can see their rotations/followings happening the ONLY reason i can think of why is because im changing their cfrme local function rotateCharacterToMouseOStyle(character)
if not character or not character:FindFirstChild("HumanoidRootPart") then
return
end

local rootPart = character.HumanoidRootPart
local camera = workspace.CurrentCamera
local mouse = player:GetMouse()

-- Get the unit ray from camera through mouse position
local unitRay = camera:ScreenPointToRay(mouse.X, mouse.Y)

-- The direction we want the character to face
local lookDirection = unitRay.Direction

-- Create rotation that makes character face this direction
local characterPosition = rootPart.Position
local targetPosition = characterPosition + lookDirection

-- Create the new CFrame
local newCFrame = CFrame.lookAt(characterPosition, targetPosition)

-- Smooth interpolation
local currentCFrame = rootPart.CFrame
local lerpedCFrame = currentCFrame:Lerp(newCFrame, 0.2)

rootPart.CFrame = lerpedCFrame

end

karmic fjord