I need help with aiming a ball.

Hello, I have been, for a while now, struggling to make an aiming system. Basically, I am holding a ball and want to throw it towards the center of the screen, where the crosshair would typically be.

However, after trying for a week to do it, I simply cannot grasp how to do a basic aiming system. The ball always goes off to somewhere else. I have looked and tried Raycasts and LookAt and none of it seems to work out. I am using AddForce when it comes to shooting, which apparently uses the world axis instead of the local one, so I don’t know if that could be the issue of it not firing properly.

If anything is needed like images or the code, just tell me and I’ll abide.

Thank you for your help!

How about AddRelativeForce, which does it in local mode?

You can find the direction the camera is looking by accessing it’s transform.forward property.

Assuming your game is 2D, you could create an empty gameobject in the center of the screen (if the camera needs to move, make that empty gameobject a child of the camera so it will follow it).
Then use LookAt to make the ball face that empty gameobject, and use

myRigidBody.AddForce (transform.forward);

to push the ball towards the center of the screen.