In a 2D game, I’d like to make a dynamic rope or cord that stretches or bends. Is this possible in Unity?
Here’s an example from deepnight’s Ludum Dare 30 entry (a Flash game).
In a 2D game, I’d like to make a dynamic rope or cord that stretches or bends. Is this possible in Unity?
Here’s an example from deepnight’s Ludum Dare 30 entry (a Flash game).
Yes, it is 100% possible, however it is not something that is build into Unity. Here is an example that may do what you are looking for: http://wiki.unity3d.com/index.php?title=LineRenderer_Rope
If not this may help: Google
(1) Never, ever program or work on something which already exists …
(2) always search the asset store. (for example if you need a “2D rope” try entering “2D rope” on the asset store)
(3) a very simple solution to get you going, just have a graphic of a hanging rope (sort of a “U” shape) and, trivially, just scale it up and down, and left and right separately, to get any shape you want.
(4) secondly, often it’s simply done like this: in the example, just make (say) 40 different images of the different possible distances between the box and the character (in the example) … so, really, it’s just a sprite set. (this is likely how it would literally be done in a commercial game which looks like that)
(5) finally this is the rope everyone uses in 3D Unity Asset Store - The Best Assets for Game Making so in complex situations you could use that and simply present it in 2D