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

Moving a Model to a Mouse Position?

Im trying to make a script that teleports a model to the mouses CFrame position! Please Help :D

Output: 18:06:23.346 - CoordinateFrame is not a valid member

target = game.Players.LocalPlayer:GetMouse().Hit
game.Workspace.Model:MoveTo(target)

2 answers

To move models with CFrame, you should use :SetPrimaryPartCFrame(**arg1**CFrame) instead of :MoveTo(**arg1** Vector3).

To use :SetPrimaryPartCFrame() , you should first set PrimaryPart by Model's Properties Tab. After setting that, you will be able to use it.

local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local model = workspace:WaitForChild("ModelName")

model:SetPrimaryPartCFrame(mouse.Hit)

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