Hello! I was wondering, how do I make my command bar slide back inside when you press enter? Yes, I do have the tweening animations ready, here’s what the code looks like;
--[[
Handler.
--]]
-- Variables --
local TweenService = game:GetService("TweenService")
local CommandBarFrame = script.Parent.CommandBarFrame
local CommandBarText = script.Parent.CommandBarFrame.CommandBar
local IntroFrame = script.Parent.InfroFrame
local DismissButton = script.Parent.InfroFrame.DismissButton
local LocalPlayer = game.Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local CMDOpen = false
-- Tweens --
local CommandBarSlideOut = TweenService:Create(CommandBarFrame, TweenInfo.new(0.4, Enum.EasingStyle.Quint, Enum.EasingDirection.Out),{Position = UDim2.new(0, 0,0.875, 0)})
local CommandBarSlideIn = TweenService:Create(CommandBarFrame, TweenInfo.new(0.4, Enum.EasingStyle.Quint, Enum.EasingDirection.In),{Position = UDim2.new(-1, 0,0.875, 0)})
local IntroFrameSlideOut = TweenService:Create(IntroFrame, TweenInfo.new(0.4, Enum.EasingStyle.Quint, Enum.EasingDirection.Out),{Position = UDim2.new(0.89, 0,0.424, 0)})
local IntroFrameSlideIn = TweenService:Create(IntroFrame, TweenInfo.new(0.4, Enum.EasingStyle.Quint, Enum.EasingDirection.In),{Position = UDim2.new(1.9, 0,0.424, 0)})
-- Keys --
Mouse.KeyDown:Connect(function(Key)
if Key == ";" and CMDOpen == false then
CommandBarSlideOut:Play()
CommandBarText:CaptureFocus()
CMDOpen = true
spawn(function()
CommandBarText.Text = ""
end)
end
end)
What methods are there? I’ve tried ReleaseFocus() when you press enter with tweens which works partly, it does release the focus but doesn’t play the animation.