actions module

This commit is contained in:
2024-02-26 03:37:27 -05:00
parent 666ffd2fcf
commit 5a4ac9ca03
10 changed files with 126 additions and 86 deletions

View File

@@ -1,3 +1,7 @@
--!optimize 2
--!native
--!strict
local Bobbing = {}
Bobbing.__index = Bobbing
@@ -84,8 +88,7 @@ local function CameraAnimation(self, dt: deltatime)
--go go boolean algebra
local MaxMinY: boolean = Camera_YArc(self.CurrentCamera)>Bobbing.MaxGimbalLockY --TODO: instead, make this an equation so it will just subtract from the existing animation radians
local ForceStop: boolean = Bobbing.ForceStop and "Stop"
local AnimationType: string = ForceStop or RootMagnitude>1 and "Walk" or (not MaxMinY and "Idle" or "Stop")
local AnimationType: string = Bobbing.ForceStop and "Stop" or RootMagnitude>1 and "Walk" or (not MaxMinY and "Idle" or "Stop")
local CurrentAnimation: CFrame = Animations[AnimationType](Bobbing.Tick, dt)
--"Lerp" so the transitions between walking and idling are smoothed instead of instant