Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why doesnt this work?

I'm trying to make it so when i click it places where the mouse is.

ERROR: CoordinateFrame is not a valid member of PlayerMouse

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Objects = game.ReplicatedStorage.Objects.Platform
Mouse.Button1Up:connect(function()
Objects:Clone().Parent = game.Workspace
Objects:MoveTo(Mouse.CoordinateFrame)
end)


2 answers

To properly get the 2D position of the PlayerMouse object, the best route is to get the Mouse.Hit property:

Objects:MoveTo(Mouse.Hit)

I hope this helped!

This discussion is preserved as it was. New answers, comments, and votes are closed.