Nature2D is a 2D physics library designed for and on Roblox! Ever wanted to create 2D games but step back because Roblox doesn't have a built-in 2D physics engine? Use Nature2D to create versatile and smooth simulations and mechanics for your 2D games with minimum effort! Nature2D primarily uses methods of Verlet Integration and Convex Hull collisions.
It's user friendly and supports all UI Elements. RigidBodies and constraints can potentially be made with almost all UI elements, from Frames to TextBoxes. Collision detection and response are also handled for all UI elements by default.
Create almost anything you can imagine. From bouncy boxes to destructible structures, even character movement in no time. Here's a wrecking ball connected to an invisible constraint knocking a few boxes off of the blue platform.
- Using the CLI - You can clone the repository on your local device and start experimenting!
$ git clone https://github.com/jaipack17/Nature2D.git
- Roblox Model - Nature2D is available on the Roblox asset store for free. You can get the model through the following link.
https://www.roblox.com/library/7625799164/Nature2D
- Using wally - Use wally, a package manager for roblox to install Nature2D in your external code editor! This requires wally to be installed on your device. Then, add Nature2D to the dependencies listed in your
wally.toml
file!
[dependencies]
Nature2D = "jaipack17/[email protected]"
After that, Run wally install
in the CLI! Nature2D should be installed in your root directory. If you encounter any errors or problems installing Nature2D using wally, open an issue!
To get started:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Nature2D = require(ReplicatedStorage.Nature2D.Engine)
local engine = Nature2D.init(screenGuiInstance)
--[[
Code here, check out the API and examples under docs/api and docs/examples!
]]--
To get familiar with the library, you can go through the documentation.
If you encounter bugs or would like to support this project by improving the code, adding new features or fixing bugs - Feel free to open issues and pull requests!