diff --git a/src/spring.luau b/src/spring.luau index e9d8fec..a01ac1c 100644 --- a/src/spring.luau +++ b/src/spring.luau @@ -203,25 +203,25 @@ local function spring(source: () -> T, period: number?, damping_ratio: number return function(...) if select("#", ...) == 0 then -- no args were given - push_child_to_scope(output) - return output.cache - end + push_child_to_scope(output) + return output.cache + end - -- set current position to value - local v = ... :: T - data.x0_123, data.x0_456 = type_to_vec6[typeof(v)](v) - - -- reset velocity - data.v_123 = ZERO - data.v_456 = ZERO - - -- schedule spring - springs[data] = output + -- set current position to value + local v = ... :: T + data.x0_123, data.x0_456 = type_to_vec6[typeof(v)](v) - -- set output to value - output.cache = v - - return v + -- reset velocity + data.v_123 = ZERO + data.v_456 = ZERO + + -- schedule spring + springs[data] = output + + -- set output to value + output.cache = v + + return v end end