I'm making a script that makes the head follow the mouse. AANNNND...
I've been receiving this error; CFrame is not a valid member of PlayerMouse
How would i then go about solving this problem?
local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local RemoteEvent = game.ReplicatedStorage.RemoteEvent repeat wait() until Player.Character local Char = Player.Character Mouse.Move:Connect(function() local Head = Player.Character.Head local Vec = Mouse.CFrame local Neck = Head.Neck RemoteEvent:FireServer(Neck, Vec) end)
local Remote = game.ReplicatedStorage.RemoteEvent Remote.OnServerEvent:Connect(function(player, Neck, Vec) for i = 0,1,.01 do wait() Neck.C0:lerp(Vec, i) end end)
Mouse.CFrame doesn't exist That's wrong
The correct thing to use is Mouse.Hit (game.Players.LocalPlayer:GetMouse().Hit)
What is mouse.Hit you ask?
it is a property indicates CFrame of the mouse’s position in 3D space
There is also a Vector3 Position
game.Players.LocalPlayer:GetMouse().Hit.p
For More Info: https://developer.roblox.com/en-us/api-reference/property/Mouse/hit