How can I make my cannon tool shoot out a ball to the mouse in the way of the red line instead of the blue.
You might want to use Bézier Curves to draw this type of trajectoy.
Is there a way I could achieve that effect with bodyvelocities?
Yes, though I wouldn’t personally use that as Bézier Curves allow more “custom” shapes and way more precise targets.
local part = Instance.new("Part", workspace)
local hrp = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart")
local Force = 60
local bv = Instance.new("BodyVelocity", part)
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = (hrp.CFrame.LookVector + hrp.CFrame.UpVector) * Force
local debris = game:GetService("Debris")
debris:AddItem(bv,.2)
My projectile is only 1 part so that’s not a problem but how would I make the cannonball shoot out of the barrel and curve down to where the player wants to shoot?
Add me on discord if that’s easier: virgin desperados#1189
I gave you the answers above.
If you want a really smooth and precise trajectory, use Bézier Curves.
If you want to do it the “easy” way, use BodyVelocities. The script I gave you above is gonna shoot the new part depending of the player’s HumanoidRootPart’s LookVector (where it is looking) and it’s UpVector (where it’s looking if we rotate it toward the sky).