The purpose of my script is to move a part to the position of the mouse (but elevated 50 studs), and gradually make it grow in size when mouse1 is being held down, and then making it stop growing and dropping when mouse1 is let go.
The script seems to work, except after the part is dropped it has very strange physics behavior such as:
Not falling right after Mouse1 is let go,
Having innacurate collision
Script:
local players = game:GetService("Players")
local runService = game:GetService("RunService")
local player = players.LocalPlayer
local mouse = player:GetMouse()
local special = game.Workspace.Special
local holding = false
mouse.Button1Down:Connect(function()
holding = true
runService.RenderStepped:Connect(function()
if holding == true then
special.Anchored = true
if (player.Character.PrimaryPart.Position - mouse.Hit.Position).Magnitude <= 500 then --This isnt relevant for the help needed, and is for later
workspace.Special.Position = mouse.Hit.Position + Vector3.new(0,50,0)
special.Size = special.Size + Vector3.new(.1,.1,.1)
end
end
end)
end)
mouse.Button1Up:Connect(function()
holding = false
special.Anchored = false
end)