Are you using the standard camerafollow script?
what may be easyer for this situation is to completely make your own camera script that has two variables that can be adjusted by the joystick, height and angle. Up and down on the joystick controls the height and left and right control the angle. Then you could move the camera by using some code like this:
next add force to the ball according to the left joystick and the camera’s angle variable. You’ll need a vector2 variable that is the difference between the joysticks original position, and where the player’s finger is on the screen. Now convert that to a vector3, but make sure you switch around z and y so that your ball goes forward and back not up and down. Then multiply that Vector3 by Quaternion.EulerAngles(0,CameraScript.angle,0).
Now you have a Vector3 that you can plug into RigidBody.AddForce.
I was hoping I could do something simpler than this though, would it be possible to apply an animation to the ball to make it rotate correctly that way?
Here is a copy of the project files to better explain what I mean:
To make the ball rotate forward in the direction the camera is pointing, you need to turn it around the camera’s X axis. You can do this with transform.Rotate:-
To calculate the angle to rotate the ball, you need to know the ball’s radius and the distance moved (which you have probably already calculated in order to move the ball). Divide the distance by the radius to get the angle in radians and then multiply this by Mathf.Rad2Deg:-
var distance = speed * Time.deltaTime; // ...or whatever.
var turnAngle = distance / ballRadius * Mathf.Rad2Deg;
transform.Rotate(Camera.main.transform.right, turnAngle);
Do you want to rotate the camera around the ball and then push the ball in the direction the camera is going, or move the ball and have the camera follow along from one side?