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