Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Best method for simulating hitting a ball?

Hello! I wanted to make a sort of sports game where you hit a ball with an object.

I have problems with the "Touched" events, where the object/part you swing goes straight through the ball. (This might be because the object you swing is already inside the ball, making the touched event not go off?)

Also Velocity seemed pretty great in solo mode but in server testing it was very clunky.

Not really looking for any lines of code, just the best method for hitting a ball.

Thanks!

1 answer

✓ Accepted answer

There's a group of objects called "BodyMovers," overall, they're great for anything when you need to interact with physics. I myself would use a BodyForce, as it accelerates the ball so much in one direction, or you could also use a BodyVelocity. As for the touched event, I'm not exactly sure, think you could clarify more on that? A gif would be really helpful. From the sounds of it you have something like collidability set to false, or something similar, but I'm unsure.

This discussion is preserved as it was. New answers, comments, and votes are closed.