I'm trying to make it show a model in the grid that I've created when I hover over one but for some reason this is not moving the model to the correct location. Any ideas? I tried researching MoveTo but I didn't entirely understand what it was asking me to do.
local Player = game:GetService("Players").LocalPlayer;
local Mouse = Player:GetMouse();
local UIS = game:GetService("UserInputService");
local RS = game:GetService("RunService");
local curT
local Plant = game.ReplicatedStorage["Plant1"]
RS:BindToRenderStep("MouseHover", Enum.RenderPriority.Camera.Value - 1, function()
local mPos = UIS:GetMouseLocation();
local Target = Mouse.Target;
if Target then
if Target.Parent then
if Target.Parent:IsA("Model") and not (Target.Parent == workspace) then
if Target.Parent.Name == "Planter" then
if Target ~= curT then
print(Target.Parent.Name)
local PlantCopy = Plant:Clone()
PlantCopy.PrimaryPart = PlantCopy["PrimePart"]
PlantCopy:MoveTo(Target.Position)
PlantCopy.Parent = game.Workspace
curT = Target
else
end
end
end
end
end
end);
