throwing objects by rotating a collider

i’m making a catapult kind of thing and on the swinging arm part, i have a box collider, and a script to rotate it

void FixedUpdate ()
    {
        if (rotating) {
        

            Vector3 r = new Vector3 (-2.5f, 0, 0);
            rotatingArm.Rotate(r);

            Debug.Log ("CatapultController rotatingArm.eulerAngles.x = " + rotatingArm.eulerAngles.x);
            if (rotatingArm.eulerAngles.x < 300)
                rotating = false;
        }
    }

i also have a ball, it has a sphere collider and rigidbody.

if i make the rotating arm with no rigidbody, then i drop the ball onto the arm, the ball sits there on the collider ok until i start rotation. when i set rotating=true the arm rotates, but it passes through the ball like its made of gas.

so i add a rigidbody, and turn ‘Is Kinemic’ on to stop the arm falling through the floor. now i drop the ball on the arm ok, then when i rotate, the ball moves correctly with the rotation of the collider. BUT, at the end of the rotation, when x<300, i stop the rotation, the ball stops. shouldn’t it go flying off the direction it was moving when it stopped?

thanks

BTW, i fixed the problem, kind of, by adding this
Rigidbody rb = objectInBasket.GetComponent ();
rb.AddForce(new Vector3(100,0,40));

in the if(x<300) case, but it seems to me like that shouldn’t be necessary?

Rotating a rigidbody via Transform.Rotate(), to the physics system, is basically teleportation. Instead set an angular velocity or apply a torque force. That should solve your issue.

thanks, i tried AddTorque but it does nothing (both with and without AddForce). AddForce works ok but then i have to calculate the vector3 the hard way. it seems like there should be a better way?

                rb.AddForce (new Vector3(15, 15, 0));  //works
                rb.AddTorque (transform.right * 100);  //does nothing

i also tried transform.up and forward and playing with different numbers

but i was able to get what i want with this
throwVector = new Vector3(15, 15, 0);
rb.AddForce ( Quaternion.AngleAxis(transform.root.eulerAngles.y, Vector3.up) * throwVector );