E
E
Emil2021-03-15 17:10:42
C++ / C#
Emil, 2021-03-15 17:10:42

How to make a 2D sprite flexible like a rope?

Good day everyone!
There is a 2D rope sprite.
604f6a5fd3efd823249152.png
The task is to make it flexible, so that the player can interact with it using physical. contact.

I understand that you need to use the Cloth component. But unfortunately it can't be done. I will be glad for your help!
(If I find an answer earlier, I'll write it here, maybe it will be useful to someone)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2021-03-17
@dollar

The idea itself is complex. Therefore, I think it would be more correct not to look for a ready-made solution, but to do it yourself. There are too many nuances that will concern your game specifically: how exactly the rope physics will work, how realistic it should be, whether (and what) optimization is needed, etc. For example, whether the character will fall if the legs get tangled in the rope is up to you.
In the game Journey (2012), the character seems to jump over his own long scarf if, for the sake of experiment, he tries to trip over it. However, the companion's scarf is not affected, and the character simply passes through it. Whether it's the laziness of the developers, or they had no choice, we don't know.

So far, I've found a solution to using joints, and splitting the rope into pieces to simulate flexibility. But it would be cool to learn how to change the sprite itself.

Good idea. Why change the sprite? This is even better, because instead of a rope sprite, you now only need a sprite of one link, which you can simply multiply.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question