I would like feedback and criticism on my UiAnimationModule to improve

Hello Devs! I am still a fairly new scripter who just hit 1 year of experience. I finally gained access to the dev forums and I would really like some feedback on the module that I have recently made, called UiAnimationModule.

As the name implies, the goal of the module is to facilitate game-making by giving the developer the abilities to :

  • Implement animation templates into a UI component, for easy and reusable animation creation.
  • Create their own animation templates using custom Tween Sequences, to use them in game.

The module works by decomposing and playing tweens frame-by-frame, and grouping those tweens in “Tween Sequences” which give the ability to combine multiple tweens in specific orders.

While the module works, it is still pretty bad from a coding standpoint, hence why I would love some constructed criticism on it. It can go from the smallest incoherences to the biggest issues., whether it’s according to your personal standards, or from a logical standpoint.

(Please note that some of the code was made with AI in an attempt to quickly get a functioning version done, due to some of the maths required being above my knowledge)

I am uploading this module with hopes of getting into actual conversations with developers who have more experience and knowledge than me, instead of facing backlash. My code is very far from perfect and might have some triggering mistakes.

If needed, my discord is “xxneweraxx”. I am active there.

Finally, I will be providing code snippets that are using the module as an example, alongside videos that showcases the result, and the uncopylocked place of the module for easy access.

Uncopylocked place :

EXAMPLE 1 : Button + Frame
Code :

task.wait(5)

local rs = game:GetService("ReplicatedStorage")
local UiAnimationModule = require(rs.UiAnimationModule)

local Frame = game.Players.LocalPlayer.PlayerGui.ServerUpgrade.Main
local Button = Frame.Parent.Parent.ScreenGui.TextButton

local Templates = UiAnimationModule.Templates

local Enter = Templates.Entry.ScaleInBottom(Frame)
local Exit = Templates.Exit.ScaleOutBottom(Frame)

local BlurIn = Templates.General.BlurIn(game.Lighting.Blur)
local BlurOut = Templates.General.BlurOut(game.Lighting.Blur)

local Rota = Templates.Interaction.Rotate(Button)
local RotaBack = Templates.Interaction.RotateBack(Button)

local ScaleBack = Templates.Interaction.ScaleBack(Button)
local ScaleUp = Templates.Interaction.ScaleUp(Button)

local GradientThrough = Templates.Interaction.GradientThrough(Button)

Enter.OnBeginning = function()
	Frame.Parent.Enabled = true
end

Exit.OnCompleted = function()
	Frame.Parent.Enabled = false
end

Button.MouseEnter:Connect(function()
	UiAnimationModule.Start(ScaleUp)
	UiAnimationModule.Start(Rota)
	UiAnimationModule.Start(GradientThrough)
end)
Button.MouseLeave:Connect(function()
	UiAnimationModule.Start(ScaleBack)
	UiAnimationModule.Start(RotaBack)
end)

Button.MouseButton1Click:Connect(function()
	if Frame.Parent.Enabled then
		UiAnimationModule.Start(Exit)
		UiAnimationModule.Start(BlurOut)
	else
		UiAnimationModule.Start(Enter)
		UiAnimationModule.Start(BlurIn)
	end
end)

Video :

EXAMPLE 2 : Image tilt
Code :

local Player = players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local Checkpoint = PlayerGui:WaitForChild("Checkpoint")
local Logo = Checkpoint.Logo -- ImageLabel

local In = UiAnimationModule.Templates.Entry.ScaleInBottom(Logo)
local Tilt = UiAnimationModule.Templates.Idle.TiltLeftRight(Logo)
local Pulse = UiAnimationModule.Templates.Idle.Pulse(Logo, {TweenParams = {Duration = .6}})
local Out = UiAnimationModule.Templates.Exit.ScaleOutBottom(Logo)

In.OnBeginning = function()
	Checkpoint.Enabled = true
end
Out.OnCompleted = function()
	Checkpoint.Enabled = false
end

local function NewStageAnim()
	UiAnimationModule.Start(In)
	task.wait(.5)
	UiAnimationModule.Start(Tilt)
	UiAnimationModule.Start(Pulse)
	task.wait(1)
	UiAnimationModule.Start(Out)
end

NewStageAnim()

Video :

2 Likes

yeah for Module it’s pretty good for me. but there are a few things that I think need to be changed in the Localscript section in StarterPlayerScripts

This line assumes that ServerUpgrade is a child of PlayerGui, but in fact ServerUpgrade is not found.

local Frame = game.Players.LocalPlayer.PlayerGui.ServerUpgrade.Main

maybe it’s safe enough to use

local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local gui = playerGui:WaitForChild("ServerUpgrade")
local Frame = gui:WaitForChild("Main")
local ButtonG = playerGui:WaitForChild("ScreenGui")
local Button = ButtonG:WaitForChild("TextButton")

Well yeah, that was just a localscript that I quickly put together as an example to demonstrate the module’s ability. In a real game i’m being careful dw :slightly_smiling_face:

This post should go to Code Review instead.

1 Like

I did try posting it under code reviews after noticing my mistake, but so far no one has answered there yet. What other solution can I try to get proper feedback?