mirror of
https://github.com/unixtensor/Roblox-Elevator-Game.git
synced 2025-12-14 14:51:55 +00:00
toggle AlignPosition.RigidityEnabled on and off when the elevator is parked or not parked
This commit is contained in:
@@ -252,7 +252,11 @@ local function GoingUpDirectionToDirectionEnum(CurrentFloor: number, RequestedFl
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function CheckFloorQueue(self: ClassConstructor)
|
local function CheckFloorQueue(self: ClassConstructor)
|
||||||
SmoothVelocity(self, 0, self.Elevator.Configuration.ParkedSmoothingTime)
|
local ParkSmoothing = SmoothVelocity(self, 0, self.Elevator.Configuration.ParkedSmoothingTime)
|
||||||
|
ParkSmoothing.Completed:Once(function()
|
||||||
|
self.Elevator.AlignPosition.Position = self.Elevator.BoxModel.Position
|
||||||
|
self.Elevator.AlignPosition.RigidityEnabled = true
|
||||||
|
end)
|
||||||
|
|
||||||
local DirectionToDirectionQueue = self.Attributes.TravelingUpwards.Value and self.RelayAlgorithm.FloorQueue.Up or self.RelayAlgorithm.FloorQueue.Down
|
local DirectionToDirectionQueue = self.Attributes.TravelingUpwards.Value and self.RelayAlgorithm.FloorQueue.Up or self.RelayAlgorithm.FloorQueue.Down
|
||||||
local DirectionToOppositeDirectionQueue = self.Attributes.TravelingUpwards.Value and self.RelayAlgorithm.FloorQueue.Down or self.RelayAlgorithm.FloorQueue.Up
|
local DirectionToOppositeDirectionQueue = self.Attributes.TravelingUpwards.Value and self.RelayAlgorithm.FloorQueue.Down or self.RelayAlgorithm.FloorQueue.Up
|
||||||
@@ -412,6 +416,7 @@ function Elevator:__TravelToFloorAsync(Level_Int, LEVEL_VEC3_Y_WRAP)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
--Set the elevator's AlignPosition to the floor Y vector
|
--Set the elevator's AlignPosition to the floor Y vector
|
||||||
|
self.Elevator.AlignPosition.RigidityEnabled = false
|
||||||
self.Elevator.AlignPosition.Position = Vector3.new(self.Elevator.AlignPosition.Position.X, LEVEL_VEC3_Y_WRAP.Y, self.Elevator.AlignPosition.Position.Z)
|
self.Elevator.AlignPosition.Position = Vector3.new(self.Elevator.AlignPosition.Position.X, LEVEL_VEC3_Y_WRAP.Y, self.Elevator.AlignPosition.Position.Z)
|
||||||
--Set the elevator's velocity
|
--Set the elevator's velocity
|
||||||
SmoothVelocity(self, self.Elevator.Configuration.MaxVelocity, self.Elevator.Configuration.MaxVelocitySmoothingTime)
|
SmoothVelocity(self, self.Elevator.Configuration.MaxVelocity, self.Elevator.Configuration.MaxVelocitySmoothingTime)
|
||||||
|
|||||||
Reference in New Issue
Block a user