Tailor Swiftly is a hackweek project I created that allows you to create dynamic cloth using common sewing paradigms. This tailoring can occur in Studio or during play time, allowing you or your players to tailor cloth into unique shapes in real-time.
If you’re interested in trying it out, check out the uncopylocked place and plugin:
Keep in mind that Tailor Swiftly is a 2024 hackweek project, so we can’t promise additional development, improvements, and bug-fixes.
How does Tailor Swiftly work? What are the main APIs?
The place provides a UI for creating and editing cloth using classic sewing paradigms. You can press the “Create Cotton” or “Create Spandex” button to make a new piece of fabric.
Each generated cloth is made of point masses and springs (for spandex) or ropes (for cotton), and the point positions are updated in each heartbeat to position the vertices of an EditableMesh.
The yellow box establishes where the new fabric is created. Click any side to reposition it.
Drape - move a point and drop it
Hold - move a point and it stays in midair where you lift it
Pin - move a point over another part and it will stay pinned to that part
Drop/Unpin - click a point to release it from being held or pinned
Tack - sew a point to any other point
Sew - drag over several points to sew each to the nearest point on another piece of fabric
Rip - undo sewing or tacking
Cut - click a point and drag through fabric to remove connections and triangles.
Additional Notes
- Check out some demos in the Tailor Swiftly video!
- If you want to use this same UI in a game, download the plugin and click “Inject in Game” before publishing. You’ll also need to enable Mesh Editing API in your game when you publish.
- If you want to create fabric in Studio and have the fabric show up and react to physics in your game, click “Inject In Game” and also uncheck “Show GUI” before publishing. You’ll also need to enable Mesh Editing API in your game when you publish.
- If you are publishing an experience with EditableMesh, keep in mind that your account needs to be verified as 13+ to enable the Allow Mesh / Image API toggles.
- If you want to see/copy/modify the source code, download the plugin and click “Inject in Game” and you’ll see all the code under ReplicatedStorage.
- Tailor Swiftly makes extensive use of DragDetectors. If you’ve worked with them and want to see advanced techniques, check out the source code.
- There’s a special script to turn off the response to air resistance in characters, otherwise they can float away.
- There’s no special physics code here. It just leverages the existing Roblox Physics engine using Parts and Constraints. In the future, Roblox would benefit from a world-class fabric engine, but we don’t have one now. Hence, it’s pretty hard to get good behavior, and Air Resistance is needed to stop the crazy motion of the spandex springs.
Thanks for dropping by! Leave a comment if you have any questions, suggestions, or feedback. What do you think you could do with this kind of concept?