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

how do you get a model to go were you have clicked?

Asked by 8 years ago

i asked this question already and i got a good answer but i dont think i understood all of it but yeah i really need this for the game i am making please help

0
:MoveTo() :SetPrimaryPartCFrame() :TranslateBy() all move models theCJarmy7 1293 — 8y
0
I edited my answer, apparently. I had 'local' capped up. Lua's case sensitivity can be annoying at some periods. rexbit 707 — 8y

1 answer

Log in to vote
0
Answered by
rexbit 707 Moderation Voter
8 years ago

Well first :GetMouse() is a necessity for accessibility of the mouse, and the model. There are certain, specific properties for Vector3, and CFrame, for an easier replacement, Vector3 will be used.

Notice, :GetMouse() must be accessed by a localscript. Firstly, accessed by LocalPlayer.

local mouse = game.Players.LocalPlayer:GetMouse()
local Model -- model title.

mouse.Button1Down:connect(function()
    Model:MoveTo(Mouse.Hit.p)
end)
0
hey thank you for answering but the Mouse next to local in line 1 is underlined red thefungamerlol 1 — 8y
Ad

Answer this question