Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How should one go about creating a in - game wind feature?

I'm thinking that I could use the for i,v in pairs to find all un-achored or hinged bricks and then add something like Body force or change the velocity or something along thoes lines, that could work for Weather vanes or things rolling on the ground for example a tumble weed. But it want to know if theirs a way that you can do it that works for thin bricks put together to be used as fabric (like a cape or a skirt) that responds to the gravity of ROBLOX and would respond to the randomized direction, or set direction (Z,Y OR Z) of a wind element that I would like to add to my game.

So far the only way I think I could do that is by having a value in game lets call it "Wind value" Wind value is the direction of the wind. I then make 2 separate scripts - one that changes the value/randomizes the value, and another that tells the game what happens when "Wind value" is a certain value. The question now is what when "Wind value" is a certain value? And to make it even more realistic I want to have another value called "Wind force" Wind force is from 0 -1 (0 being no wind and 1 being strongest wind) Wind value is XYZ Ideas?

1 answer

Verlet Integration

You're now looking into the world of magical maths. If you want to make cloth, you're going to need to start looking into either implementing Verlet Integration (or another integration such as Euler's Method), at which point it is simple enough to apply a non-uniform directional force to the cloth. You will of course have to work out occlusion for where to apply force, but I believe that EgoMoose covered that in a blog post.

1 comment

0

I think I understand what EgoMoose is trying to show in the Wiki post. I just don't quite understand how to implement that into my game

This discussion is preserved as it was. New answers, comments, and votes are closed.