From dde8b208c8311b6ac36bfe208d6754b6fabe171b Mon Sep 17 00:00:00 2001 From: Stephen Leitnick Date: Sun, 21 Apr 2024 23:11:55 -0400 Subject: [PATCH] Fix shake stability --- README.md | 2 +- modules/shake/init.lua | 6 +++--- modules/shake/package.json | 2 +- modules/shake/wally.toml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d26077f4..868d4d96 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ | [Quaternion](https://sleitnick.github.io/RbxUtil/api/Quaternion) | `Quaternion = "sleitnick/quaternion@0.2.3"` | Quaternion class | | [Sequent](https://sleitnick.github.io/RbxUtil/api/Sequent) | `Sequent = "sleitnick/sequent@0.1.0"` | Sequent class | | [Ser](https://sleitnick.github.io/RbxUtil/api/Ser) | `Ser = "sleitnick/ser@1.0.5"` | Ser class for serialization and deserialization | -| [Shake](https://sleitnick.github.io/RbxUtil/api/Shake) | `Shake = "sleitnick/shake@1.0.1"` | Shake class for making things shake | +| [Shake](https://sleitnick.github.io/RbxUtil/api/Shake) | `Shake = "sleitnick/shake@1.1.0"` | Shake class for making things shake | | [Signal](https://sleitnick.github.io/RbxUtil/api/Signal) | `Signal = "sleitnick/signal@2.0.1"` | Signal class | | [Silo](https://sleitnick.github.io/RbxUtil/api/Silo) | `Silo = "sleitnick/silo@0.2.0"` | State container class | | [Streamable](https://sleitnick.github.io/RbxUtil/api/Streamable) | `Streamable = "sleitnick/streamable@1.2.4"` | Streamable class and StreamableUtil | diff --git a/modules/shake/init.lua b/modules/shake/init.lua index 3affe02b..73757170 100644 --- a/modules/shake/init.lua +++ b/modules/shake/init.lua @@ -103,7 +103,7 @@ local renderId = 0 -- Multiplies against the shake vector to control the final amplitude of the position. -- Can be seen internally as: position = shakeVector * fadeInOut * positionInfluence - shake.PositionInfluence = Vector3.new(1, 1, 1) + shake.PositionInfluence = Vector3.one -- Multiplies against the shake vector to control the final amplitude of the rotation. -- Can be seen internally as: position = shakeVector * fadeInOut * rotationInfluence @@ -215,7 +215,7 @@ function Shake.new(): Shake self.RotationInfluence = Vector3.one self.TimeFunction = if RunService:IsRunning() then time else os.clock - self._timeOffset = rng:NextNumber(-1e9, 1e9) + self._timeOffset = rng:NextNumber(-1e6, 1e6) self._startTime = 0 self._running = false self._signalConnections = {} @@ -355,7 +355,7 @@ function Shake:Update(): (Vector3, Vector3, boolean) local now = self.TimeFunction() local dur = now - self._startTime - local noiseInput = ((now + self._timeOffset) / self.Frequency) % 1000000 + local noiseInput = ((now + self._timeOffset) / self.Frequency) % 10000 local multiplierFadeIn = 1 local multiplierFadeOut = 1 diff --git a/modules/shake/package.json b/modules/shake/package.json index c062a98c..a343f7e4 100644 --- a/modules/shake/package.json +++ b/modules/shake/package.json @@ -1,6 +1,6 @@ { "name": "@rbxutil/shake", - "version": "1.0.1", + "version": "1.1.0", "main": "init.lua", "repository": "github:Sleitnick/RbxUtil", "license": "MIT", diff --git a/modules/shake/wally.toml b/modules/shake/wally.toml index 5c855b39..34c36e58 100644 --- a/modules/shake/wally.toml +++ b/modules/shake/wally.toml @@ -1,7 +1,7 @@ [package] name = "sleitnick/shake" description = "Shake class for making things shake" -version = "1.0.1" +version = "1.1.0" license = "MIT" authors = ["Stephen Leitnick"] registry = "https://github.com/UpliftGames/wally-index"