Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dervexdev/advancedspring
Advanced Spring lets you create spring class for every major Roblox & Luau datatype
https://github.com/dervexdev/advancedspring
Last synced: about 1 month ago
JSON representation
Advanced Spring lets you create spring class for every major Roblox & Luau datatype
- Host: GitHub
- URL: https://github.com/dervexdev/advancedspring
- Owner: DervexDev
- License: apache-2.0
- Created: 2023-07-19T20:20:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-19T20:28:25.000Z (over 1 year ago)
- Last Synced: 2024-05-02T05:30:01.902Z (8 months ago)
- Language: Lua
- Homepage: https://wally.run/package/dervexhero/advancedspring
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Advanced Spring
Advanced Spring lets you create spring class for every major Roblox & Luau datatype## About
Supported datatypes: `boolean`, `number`, `BrickColor`, `CFrame`, `Color3`, `ColorSequence`, `NumberRange`, `NumberSequence`, `Rect`, `UDim`, `UDim2`, `Vector2`, `Vector3`. You can set **initial position**, **damping ratio** and **frequency** when creating new spring instance or by creating config file or by changing `DEFAULT_SETTINGS`.## API Usage
```lua
local Spring = require(path.to.this.module)-- Creates new spring class with optional initial position and settings
local spring = Spring.new(Vector3.new())-- Sets new spring goal
spring:Set(Vector3.new(4, 2, 0))-- Updates spring by delta seconds
spring:Step(delta)-- Returns current spring position
part.Position = spring:Get()-- Sets new goal, updates spring and returns current position
part.Position = spring:All(Vector3.new(4, 2, 0), delta)
```## Limitations
* CFrame - only position is supported (it may change in the future)
* ColorSequence & NumberSequence - only first and last keypoints are supported## Credits
Part of this code was written by @Fraktality