Why does my ball not move when a force is applied to it?
I want to create a tool that makes a ball that goes in the direction of when the player clicked. When the player clicks it creates the ball but the ball does not go anywhere.
02 | local tool = script.Parent |
03 | local RS = game:GetService( "ReplicatedStorage" ) |
04 | local createPartEvent = RS:WaitForChild( "CreatePartEvent" ) |
06 | tool.Equipped:Connect( function (mouse) |
07 | mouse.Button 1 Down:Connect( function () |
10 | (mouse.Hit.p - tool.Tip.CFrame.p).unit * 300 |
12 | local ignore = game:GetService( "Players" ).LocalPlayer.Character |
13 | local hit, position = workspace:FindPartOnRay(ray, ignore, false , true ) |
16 | createPartEvent:FireServer(hit, position) |
02 | local RS = game:GetService( "ReplicatedStorage" ) |
03 | local createPartEvent = Instance.new( "RemoteEvent" ) |
04 | local tool = script.Parent |
05 | createPartEvent.Parent = RS |
06 | createPartEvent.Name = "CreatePartEvent" |
08 | createPartEvent.OnServerEvent:Connect( function (player, hit, position) |
09 | local ball = Instance.new( "Part" ) |
10 | ball.Parent = workspace |
11 | ball.BrickColor = BrickColor.new( "Bright red" ) |
12 | ball.Material = "Neon" |
14 | ball.Transparency = . 25 |
16 | ball.CanCollide = false |
17 | ball.Size = Vector 3. new( 2 , 2 , 2 ) |
18 | ball.CFrame = tool.Tip.CFrame |
20 | local bv = Instance.new( "BodyVelocity" ) |
22 | bv.MaxForce = Vector 3. new( math.huge , math.huge , math.huge ) |
24 | bv.Velocity = position |