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

Ball glitches out of a player's Hand? Somebody help?

Asked by 6 years ago
Edited 6 years ago
local plr = game.Players.LocalPlayer
local gui = script.Parent
gui.MouseButton1Click:Connect(function(mouse)
    mouse.Icon =  "http://www.roblox.com/asset?id=163023520"
end)
local Mouse = plr:GetMouse()
function Fastball()
    if Mouse then
        local Location = Mouse.Hit
        local part = Instance.new("Part")
        local bvelo = Instance.new("BodyAngularVelocity")
        part.Parent = game.Workspace
        part.Size = Vector3.new(2,2,2)
'       part.Shape = 0
        part.Position = plr.Character.RightHand.Position
        bvelo.AngularVelocity = Vector3.new(50,-5,0)
        bvelo.P = 2.3
        part.Anchored = true
        part.CanCollide = false
        wait(1)
        part.Anchored = false
        part.CanCollide = true -- This is where my problem is occurring
        if part.Position.y == Location.y then
            part:Destroy()
        end
    end
end
Mouse.Button1Down:Connect(Fastball)

The question title explains my problem. Whenever the function is fired, the ball glitches out of my right hand and looks real weird.

0
try using CFrame instead of position and then parenting in the end g1o2r3d4a5n6 350 — 6y
0
that is what BodyAngularVelocity is for, you clearly didn't see it DeceptiveCaster 3761 — 6y

Answer this question