#Mouse Tracking to server replicator
1 messages · Page 1 of 1 (latest)
What exactly do you mean?
If it's a part following their mouse then you can give them network ownership of the part and do control from client
it wasnt a part it purely just the character rotating and following the mouse to world position BUT i have switched to a part hopefully this works
uh
why do u need to use remote event for that
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
so its their own mouse
moving their own character
they already have network ownership so u should be able to move them on client
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
no idea