How to send BodyForce projectile to mouse position?

I am trying to create a bow and arrow atm and originally I had used BodyVelocity to launch the arrow, but I realized that there is no way to create arrow drop with BodyVelocity (I think, If I’m wrong please let me know). So I am trying to switch to BodyForce at the minute

My issue right now is that I can’t figure out how to send the projectile to the mouse position.

Here is the code I have right now

		local bf = Instance.new("BodyForce")
		
		bf.Force = Vector3.new(direction - script.Parent.Parent.HumanoidRootPart.Position).Unit * arrow:GetMass() * 10
		
		bf.Parent = arrow

(direction is just mousePos)

I would not use any body movers, and instead calculate the initial velocity you need to reach your goal and just set it directly, like the basketball in this article:

2 Likes

I appreciate the source and I actually plan on looking to use that instead of body velocity, but I’m having an issue I can’t fix with this script.

I’ve had this issue before where the farther from the character you click, the faster the projectile travels. Last time I just added .Unit to the end of the velocity formula but now that is not working and actually messing up the formula, and idea on how to fix this?

Clip:

local v0 = (mouse.Hit.p - x0 - 0.5*g*t*t)/t
1 Like

My bad, I thought that’s the effect you were looking for.

Do you just want the arrow to just have an initial velocity in the direction of your mouse? Because that’s just

arrow.Velocity = (mouse.Hit.Position - v0).Unit * initialSpeed
1 Like

Ah this worked for me after i changed the “t” variable to a smaller value, appreciate the help