mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 06:41:55 +00:00
more emote support stuff
This commit is contained in:
@@ -8,6 +8,7 @@ Bobbing.AnimationAlpha = 0.5
|
||||
Bobbing.MaxGimbalLockY = 65
|
||||
Bobbing.AnimationSpeed = 200
|
||||
Bobbing.Tick = 0
|
||||
Bobbing.ForceStop = false
|
||||
|
||||
type AnimationsMap = {[string]: (tick: number, dt: number) -> Euler}
|
||||
|
||||
@@ -60,6 +61,10 @@ function Animations.Stop()
|
||||
return ANG(0,0,0)
|
||||
end
|
||||
|
||||
function Animations.Falling()
|
||||
return ANG(0,0,0)
|
||||
end
|
||||
|
||||
local function maxmin(min: number, mid: number, max: number): number
|
||||
return math.max(min, math.min(mid, max))
|
||||
end
|
||||
@@ -70,13 +75,18 @@ local function Camera_YArc(Camera: Camera): EulerValue --stop Euler gimbal lock
|
||||
end
|
||||
|
||||
local function CameraAnimation(self, dt: deltatime)
|
||||
--crying
|
||||
Bobbing.Tick += 1
|
||||
local Root = self.HumanoidRootPart
|
||||
local RootMagnitude = Root:GetVelocityAtPosition(Root.Position).Magnitude
|
||||
|
||||
local MaxMinY = Camera_YArc(self.CurrentCamera)>Bobbing.MaxGimbalLockY --TODO: instead, make this an equation so it will just subtract from the existing animation radians
|
||||
local AnimationType = RootMagnitude>1 and "Walk" or (not MaxMinY and "Idle" or "Stop")
|
||||
local CurrentAnimation = Animations[AnimationType](Bobbing.Tick, dt)
|
||||
local Root: BasePart = self.HumanoidRootPart
|
||||
local Velocity: Vector3 = Root:GetVelocityAtPosition(Root.Position)
|
||||
local RootMagnitude: number = Velocity.Magnitude
|
||||
|
||||
--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 CurrentAnimation: CFrame = Animations[AnimationType](Bobbing.Tick, dt)
|
||||
|
||||
--"Lerp" so the transitions between walking and idling are smoothed instead of instant
|
||||
return Animation:Lerp(CurrentAnimation, Bobbing.AnimationAlpha)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
local CoreGuis = {
|
||||
AllowReset = false,
|
||||
AllowEmotes = false, --controversial
|
||||
AllowBackpack = false
|
||||
AllowEmotes = true,
|
||||
AllowBackpack = false,
|
||||
AllowPlayerList = false
|
||||
}
|
||||
CoreGuis.__index = CoreGuis
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ local CrosshairSettings = require(UI:WaitForChild("Crosshair"))
|
||||
local VignetteSettings = require(UI:WaitForChild("Vignette"))
|
||||
local CoreGuis = require(script:WaitForChild("CoreGuis"))
|
||||
local Mouse = require(script:WaitForChild("Mouse"))
|
||||
local CameraSettings = require(script:WaitForChild("Camera"))
|
||||
|
||||
local Players = game:GetService("Players")
|
||||
local Storage = game:GetService("ReplicatedStorage")
|
||||
@@ -11,6 +10,7 @@ local Storage = game:GetService("ReplicatedStorage")
|
||||
local ClientStorage = Storage:WaitForChild("Client")
|
||||
local LoadCompleted = ClientStorage:WaitForChild("LoadingComplete")
|
||||
local KeyBindsModule = require(ClientStorage:WaitForChild("KeyBinds"))
|
||||
local CameraSettings = require(ClientStorage:WaitForChild("Camera"))
|
||||
|
||||
local Player = Players.LocalPlayer
|
||||
local PlayerGui = Player:WaitForChild("PlayerGui")
|
||||
|
||||
Reference in New Issue
Block a user