How do I calculate the trajectory for a bow and show it with a beam?

Hey there everyone,

Recently I’ve been trying to create bow and arrows, but after looking around on the forum it’s too confusing for me. I’ve got no idea how to show or calculate the trajectory, I’m trying to achieve something similar the bow in bedwars like this: Bedwars Bow Clip

Here is my current script, it has a handle with two attachments and a beam inside.

local bow = script.Parent
local handle = bow.Handle
local start_att = handle.StartAtt
local target_att = handle.TargetAtt
local beam = handle.Beam
local input_service = game:GetService("UserInputService")

input_service.InputBegan:Connect(function(key, p)
	if p then return end
	if key.UserInputType == Enum.UserInputType.MouseButton1 then
		beam.Enabled = true
	end
end)
input_service.InputEnded:Connect(function(key, p)
	if p then return end
	if key.UserInputType == Enum.UserInputType.MouseButton1 then
		beam.Enabled = false
	end
end)

Help would be greatly appreicated!

2 Likes

this works but i dont always want the shape of the trajectory to be a parabola, in bedwars if you shoot an arrow at around head height to a wall pretty close in front of you, the trajectory is almost linear, but for this formula the shape just becomes a really tall parabola like this:

edit: nvm i figuired it out

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.