i had to modify my SpawnNewBall method like this, code in the video throws this error
MissingComponentException: There is no ‘SpringJoint2D’ attached to the “Ball(Clone)” game object, but a script is trying to access it.
You probably need to add a SpringJoint2D to the game object “Ball(Clone)”. Or your script needs to check if the component is attached before using it.
BallHandler.SpawnNewBall () (at Assets/Scripts/BallHandler.cs:61)
BallHandler.Start () (at Assets/Scripts/BallHandler.cs:24)
private void SpawnNewBall() {
GameObject ballInstance = Object.Instantiate(ballPrefab, pivot.position, Quaternion.identity);
currentBallRigidbody = ballInstance.GetComponent<Rigidbody2D>();
currentBallSpringJoint = pivot.GetComponent<SpringJoint2D>();
currentBallSpringJoint.enabled = true;
currentBallSpringJoint.connectedBody = currentBallRigidbody;
}