2d basketball net - hinge joint issue

Hello,

I’m trying to create a basketball net that stretches accordingly when a ball is being passed through it. I tried creating hinge joints for a bunch of rectangles formed into a net. I also added colliders to rectangles on the sides so that they would react to the ball and pull the ones in the middle with them. The problem at the moment is that the net sort of tears appart instead of stretching.

Has anybody any idea how to fix it, or any other way to create a basketball net?

Take a look at this scene which shows the use of adding a DistanceJoint2D to stop other joints (in this case in the configuration of a chain) from moving apart by setting its MaxDistanceOnly property to true. This means you’re adding, at key points, a joint to stop it moving beyond a certain distance apart but can also be less.

In the end though, it’ll come from the forces involved which ultimately resides on how you’ve configured this via the mass of the net and ball as well as the velocity it impacts the net.

Also, note that you are free to not use the default number of solver iterations which are available in the Physics 2D settings. These are there to give the solver more chance to solve more complex situations, especially when joints are involved which can be particularly tricky.

1 Like