- Home /
How to Create Effective Collider for a Rubber Band Object
I'm making a 2D game with rubber bands as the central mechanic. Basically, I need to be able to make two-dimensional rubber bands that can hang realistically from pegs, be launched by stretching and releasing them, be stretched tightly between two or more pegs, support objects that can roll down them, and have the potential to be stretched long enough that they "break." The game is not top-down, by the way, so gravity is a factor.
Right now, I have a rubber band object, which, upon creation, makes 20 or so vertices in a circle, each one connected to the next by a spring joint. Naturally, I need a collision system so that the rubber bands can stretch between pegs and support rolling objects. I tried making each vertex in the rubber band have a 6-vertex polygon collider, which updates each frame to stretch between the vertex and its two neighboring vertices, if that makes sense. This version can hang reasonably realistically off of pegs and lie on the floor.
The problem is that if I try to stretch the rubber band at all, by keeping one peg still and moving another peg, it falls right off the second peg before any tension can build. This makes it impossible to launch rubber bands using the tension of the spring joints. I'm not sure what to try next - maybe somehow attach some of the vertices to the peg when it starts pulling? I'm starting to wonder if using a loop of spring joints to simulate a rubber band was a good idea in the first place. Any help or suggestions would be greatly appreciated!
Your answer
Follow this Question
Related Questions
How do I use a 2D polygon collider to generate a correct collider for my randomly generated mesh? 0 Answers
Efficient generation of 2d polygon collider 0 Answers
¿How to make a ball react properly against two different physic's materials? 0 Answers