I'm working on the pitches for my baseball game and came upon a difficulty. That difficulty involves scripting a knuckleball, which "shimmies" and can go either straight down or side to side. I tested the script using this formula for a sine wave:

for i = 1,100 do
	local n = 37 * math.sin(8i + math.pi / 2i)
	ball.Position.CFrame = CFrame.new(Vector3.new((n+5.5), 5, n) -- The ball is a projectile
	wait(0.25)	
end

And yet this does not work because the ball does random things. So how would I make something move in a sideways sine wave? Help and examples would be greatly appreciated.

1 comment

0

idk