How to curve a soccer ball?

Heyo! We’ve recently been trying to smoothen out the soccer ball mechanics for our game, Roblox Football Club.

We’ve gotten client-server ball replication, basic dribbling & shooting however we do miss one of the biggest fundamentals: ball curving.

The idea we came down to is to record your mouse’s position while holding the left mouse button (you hold the mouse button to shoot) & translate that to the ball, however we have no idea of how to implement this:

  • How would we go about translating a 2d position in a 3d environment?
  • How do we override/change the velocity of the ball so it curves?
  • How do you determine the power of the curve?

Other games in our genre have simply just added the ability to select your left foot/right foot mechanic and always have a SET curve velocity depending on which foot you choose (to go left or right) however I feel like that is very limiting and doesn’t give much control for the player

Here’s a video of our current gameplay so you have a better glimpse of what we’ve done so far:

How do you already add force to the ball? Body velocity?

In physics, a projectile curves when there is a constant force applied to it. So if you want the ball to curve you would probably want to add a VectorForce to it and then delete it when it hits the ground (so it doesn’t curve forever)

As for translating 2d position to 3d position and vice versa, use :WorldToViewportPoint() and mouse.Hit.Position

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