Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a projectile move in a sideways sine wave?

Asked by 5 years ago
Edited 5 years ago

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.

0
idk Ind1v1duals 43 — 5y

Answer this question