Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesnt this work?

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

Because im pretty sure you cant use CoordinateFrame on the Mouse. From what i read, its Origin(so your just replacing words). The Wiki should tell you what you need to know http://wiki.roblox.com/index.php?title=API:Class/PlayerMouse

Ad
Log in to vote
0
Answered by 9 years ago

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!

Answer this question