Hello, I've been trying to script a ball that flies after the player clicks it. I've tried a script where the ball actually does leave the hand, but it doesn't go
This was the script I had:
local ball = script.Parent.Handle
local tool = script.Parent
local character = game:GetService("Players").LocalPlayer.Character or game:GetService("Players").LocalPlayer.CharacterAdded:wait()
tool.Equipped:connect(function(Mouse)
Mouse.Button1Down:connect(function()
local b = ball:Clone()
b.Parent = game.Workspace
local P = Instance.new("BodyPosition", b)
P.Position = character.Head.Position + Vector3.new(0, 0, 0.5)
local V = Instance.new("BodyVelocity", b)
V.Velocity = Vector3.new(1, 0, 0)
wait(.1)
tool.Parent = game.ServerStorage
end)
end)
In this script, the ball did fly through the air. However, I want to change it so that instead of the ball having to follow the axes, and it always go in the same direction, it will always move directly in front of the player. (I don't have very much experience with this type of scripting)
How could I change
V.Velocity = Vector3.new(1, 0, 0)
so that the ball always in what the player sees as in front of them?

2 comments
This script makes the ball go sideways, and it does't nearly go fast enough. How would I fix this?
Told you how to increase speed. And what do you mean by sideways? Part moves the wrong direction? This is perfect velocity code. again try removing the BodyPosition, OR change MaxForce properties. Let me know what you do