• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


01 Dec, 2024

Updated at 14 Dec, 2024

Menu shakes while opens

Im trying to make animation like the Menu apears from the hole, but i cant solve these two bugs: the frame renders only when i update ImageButton, and this shaking animation.
изображение_2024-11-30_225406506

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local TweenService = game:GetService("TweenService")
local Style1 = TweenInfo.new(5,Enum.EasingStyle.Linear) 

local Button = script.Parent
local UpgradesMenu  = Button.Parent.Parent.UpgradeMenu
local GUI = Button.Parent
local Menu = UpgradesMenu.UpgradesMenu.Menu

local Diagonal = math.sqrt(math.pow(UpgradesMenu.AbsoluteSize.X,2)+math.pow(UpgradesMenu.AbsoluteSize.Y,2))

UpgradesMenu.Enabled = false

Button.MouseButton1Click:Connect(function()
	
	UpgradesMenu.UpgradesMenu.UICorner.CornerRadius = UDim.new(1,0)
	UpgradesMenu.UpgradesMenu.Position = Button.Position
	UpgradesMenu.UpgradesMenu.Size = UDim2.new(0,0,0,0)

	Menu.AnchorPoint  = Vector2.new(Button.Position.X.Scale,Button.Position.Y.Scale)
	Menu.Position = UDim2.new(0.5,0,0.5,0)
	Menu.Size = UDim2.new(0,UpgradesMenu.AbsoluteSize.X,0,UpgradesMenu.AbsoluteSize.Y)
	
	UpgradesMenu.Enabled = true
	
	TweenService:Create(UpgradesMenu.UpgradesMenu,Style1,{
		Size = UDim2.new(0,Diagonal*2,0,Diagonal*2)
	}):Play()
	
end)

1 post - 1 participant

Read full topic