Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloth is super stretchy, no way to reduce elasticity #13

Open
hsandt opened this issue Nov 5, 2024 · 2 comments
Open

Cloth is super stretchy, no way to reduce elasticity #13

hsandt opened this issue Nov 5, 2024 · 2 comments

Comments

@hsandt
Copy link

hsandt commented Nov 5, 2024

Thanks for making this plugin, I was trying to make a 2D cloth for a scarf for my character, following the tutorial to attach it to a moving character.

However, whatever parameters I use, it stretches a lot more than expect. I expected it to be a little elastic, but in this case it goes much too far when the character moves around.

2024-11-05_15-37-13

2024-11-05_15-37-15

I can reduce Softness (in pin point mode) to 10 but still, I get a long scarf:

2024-11-05_15-37-37

and playing with other parameters and spring mode makes it even worse:

2024-11-05_15-48-47
2024-11-05_15-49-16

Is there a way to simply ensure the cloth never stretches more than, say, 5% of its original size, for reasonable character speeds?

I like the Asparagus in the GIF demo in the README, it doesn't stretch too much. But then again it's not attached to a character - plus for some reason I can't find the scene shown in the gif in the addon samples folder.

I've been looking at this other 3rd party solution: https://github.com/coffe789/Godot-2D-Cloth-and-Verlet-Physics-Simulator but it's quite hardcoded and so it seems harder for me to switch from a square cloth to a rectangle cloth like my scarf.

I may try to just use pin points and some custom physics bodies for now...

@Ughuuu
Copy link
Collaborator

Ughuuu commented Nov 5, 2024

This depends on physics server and what settings you set. I'm sure there might be some settings to make it better. Right now it seems like you are making a long line? Try pin joint with softness, or for springjoint there is damping and stiffness. Playing with these gives some results(eg damping 1000000 stiffness 0.001, stiffness 1000000, damping 0.0001, etc try a lot of values, try different values. Not just from 0 to 20. I think it also depends on mass you use, distance between shapes etc).
End of the day this plugin just creates rigidbodies and joints. Thats it. How the physics server handles that and what values you should out those are found trhough experimenting. Try if not to start from demo i provide and work your way from there.

@Ughuuu
Copy link
Collaborator

Ughuuu commented Nov 5, 2024

Anyway, if u need help with this, more info should be provided. Maybe join the discord and talk there, or post more info here, eg how does softbody texture used look like, what size the texture has, what size the shapes have, what masses, etc. provide also a project zip archived to test this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants