Hello, like the title says, I had part of a script that makes a part follow the mouse whenever it is active. The problem is whenever the player looks upwards, the part just disappears into the sky as the mouse’s position says that it’s at a very high altitude. How can I prevent it from going up and only stay on ground level at all times, and would I need to check for ground level if I wanna achieve such result?
a = game:GetService("RunService").RenderStepped:Connect(function()
part.Position = game.Players.LocalPlayer:GetMouse().Hit.Position
mouse.TargetFilter = part
end)
a = game:GetService("RunService").RenderStepped:Connect(function()
local mouse = game.Players.LocalPlayer:GetMouse()
if mouse.Target then
part.Position = mouse.Hit.Position
end
mouse.TargetFilter = part
end)