Show raw api
{
"functions": [
{
"name": "new",
"desc": "Creates a new spring.\n\nThe type `T` can be a `number`, `Vector2`, `Vector3`, or `CFrame`.",
"params": [
{
"name": "initial",
"desc": "Initial value",
"lua_type": "T"
},
{
"name": "smoothTime",
"desc": "Approximate time it takes to reach target",
"lua_type": "number"
},
{
"name": "maxSpeed",
"desc": "Maximum speed (defaults to infinity)",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Spring<T>\n"
}
],
"function_type": "static",
"source": {
"line": 35,
"path": "modules/spring/init.luau"
}
},
{
"name": "Update",
"desc": "Updates the spring. This method should be called continuously, even if the target value hasn't changed.\n\n```lua\nlocal newValue = spring:Update(dt)\n```",
"params": [
{
"name": "deltaTime",
"desc": "",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "T"
}
],
"function_type": "method",
"source": {
"line": 60,
"path": "modules/spring/init.luau"
}
},
{
"name": "Impulse",
"desc": "Impulses the spring.\n\n```lua\nspring:Impulse(rng:NextUnitVector() * 10)\n```",
"params": [
{
"name": "velocity",
"desc": "",
"lua_type": "T"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 79,
"path": "modules/spring/init.luau"
}
},
{
"name": "Reset",
"desc": "Resets the spring to the given value.",
"params": [
{
"name": "value",
"desc": "",
"lua_type": "T"
}
],
"returns": [],
"function_type": "method",
"source": {
"line": 91,
"path": "modules/spring/init.luau"
}
}
],
"properties": [],
"types": [],
"name": "Spring",
"desc": "Simulates a critically damped spring. This is mostly just a wrapper around\n[`TweenService:SmoothDamp()`](https://create.roblox.com/docs/reference/engine/classes/TweenService#SmoothDamp).",
"source": {
"line": 9,
"path": "modules/spring/init.luau"
}
}