Best way to add curve

Hello, I’m currently trying to add a curve effects in the direction of the players movement, but I can’t get it to look like its not just going straight and taking a sharp turn

function Shoot.fire(player, character, ball, height, power)
	local lookDirection = character.HumanoidRootPart.CFrame.LookVector
	local humanoid = character.Humanoid
	local moveVector = humanoid.MoveDirection

	local shootAnim = humanoid:LoadAnimation(script.Shoot)
	shootAnim:Play()
	ball.Hit:Play()

	-- Base forward velocity
	local bodyVelocity = Instance.new("BodyVelocity")
	bodyVelocity.MaxForce = Vector3.new(4000, 4000, 4000)
	local forwardVelocity = lookDirection * power
	bodyVelocity.Velocity = Vector3.new(forwardVelocity.X, height, forwardVelocity.Z)
	bodyVelocity.Parent = ball

	-- Sideways curve force (applied continuously)
	local bodyForce = Instance.new("BodyForce")
	bodyForce.Force = Vector3.new(moveVector.X, 0, moveVector.Z) * 100 -- adjust strength
	bodyForce.Parent = ball

	-- Cleanup
	player.PlayerValues.HasBall.Value = false
	ball.WeldConstraint.Part1 = nil
	game:GetService("Debris"):AddItem(bodyVelocity, 0.3)
	game:GetService("Debris"):AddItem(bodyForce, .5) -- curve lasts a bit longer
end

please help

You can tween or lerp the bodyvelocity.velocity to vector3.zero if you like. This way the ball goes up less and less. Otherwise, I’d look into raymarching for this specific effect. Raymarching gives you more control instead of relying on roblox physics.

nvm I just add a body vector thanks anyway

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