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

How do I change a model's position?

Asked by 7 years ago
Edited 7 years ago

I made this localscript for a tool that clones a union called "LightingModel" from Lighting to Workspace, and it's position is set to wherever I click, but I'd like to know how to set a model's position instead of having to make a union.

local lightingModel = game.Lighting.LightingModel:clone()

local player = game.Players.LocalPlayer

local mouse = player:GetMouse()

script.Parent.Activated:connect(function()

print(mouse.Hit.p)

lightingModel.Parent = game.Workspace

lightingModel.Position = mouse.Hit.p

lightingModel.Anchored = true

end)

Thank you.

1 answer

Log in to vote
0
Answered by
udoxas 75
7 years ago

Use the MoveTo function: http://wiki.roblox.com/index.php?title=API:Class/Model/MoveTo

Ad

Answer this question