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

Best method for simulating hitting a ball?

Asked by
Acryius 22
5 years ago

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

Log in to vote
0
Answered by
Tomstah 401 Moderation Voter
5 years ago

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.

Ad

Answer this question