How would I calculate the arc of a projectile to make realistic gun physics?

The arc is a quadratic equation with 3 input vectors g gravity, v velocity, and an initial position. t is time from starting point.

local function projectileMotionEquation(g, v, initialPosition, t)
--See Ego Mooses tutorial on integrating projectile motion equation
	return 0.5 * g * t ^ 2 + v * t + initialPosition
end
1 Like