Skip to content

Commit

Permalink
SPHI-22 Speed, dampening, and value can all now be set on springs
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaGobble committed Aug 1, 2024
1 parent 64295df commit 0147d79
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Components/Animation/Spring.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,18 @@ function Spring:__call(Value : any, Speed : number, Dampening : number) : Spring
Spring.Coordinate2 = Dampening / High * Spring.Coordinate1 + Velocity / (Speed * High)
end
end
elseif Index == "Value" then
local UnpackedNewValue = UnpackType(NewValue, ValueType)

for Index, Spring in ipairs(UnpackedSprings) do
Spring.Position0 = UnpackedNewValue[Index]
Spring.Coordinate1, Spring.Coordinate2, Spring.Velocity = 0, 0, 0
Spring.Tick0 = os.clock()
end
elseif Index == "Dampening" then
Dampening = NewValue
elseif Index == "Speed" then
Speed = NewValue
end
end,

Expand Down

0 comments on commit 0147d79

Please sign in to comment.