Part that flies away when I drop

Hello, I have a problem. I have a script that allows me to transport parts that follow a frame to the screen. The problem is that when I drop these parts, they fly away…
Thanks to anyone who could help me!

My script:
`local raycastParams =
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
raycastParams.FilterDescendantsInstances = {target}

local position = Frame.AbsolutePosition
local size = Frame.AbsoluteSize
local unitRay = Camera:ScreenPointToRay(position.X + size.X/2, position.Y + size.Y/2)

local raycastResult = game.Workspace:Raycast(unitRay.Origin, unitRay.Direction * 30, raycastParams)
local frameWorldSpace = raycastResult and raycastResult.Position or unitRay.Origin + unitRay.Direction * 30

			target.Position = frameWorldSpace

			if MOBILE.Value == 2 then

				game.Players.LocalPlayer.PlayerGui.MobileVersion.DropButton.Visible = false
				game.Players.LocalPlayer.PlayerGui.MobileVersion.Frame.Visible = false
				target.Anchored = true
				target.Anchored = false
				MOBILE.Value = 0
				script.Disabled = true
				script.Disabled = false`

1 Like

RESOLU, un autre script de Grab empechait l’autre de correctement fonctionné : )

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.