Hey developers! I personally have been learning how to tween guis and parts! And some people where messaging asking for help with it so I have made this opensource tutorial.
This is just a base where you can expand of to your own project. This is not a full system made exactly for your game you still have to do a little coding but i’m here to help!
First you need to create a part make sure to anchor it and put it away from spawn, then you can name it whatever.
Then, you need to create a ScreenGui & a TextButton!
Finally create a LocalScript
--[[
Script: Tween Animation
Description: This script animates the camera's position using TweenService.
The camera moves to a target position when a button is clicked.
Author: @Devycreates
Date: 2024-07-07
]]
local tweenService = game:GetService("TweenService")
-- Button click event to animate the camera
script.Parent.MouseButton1Click:Connect(function()
local cam = game.Workspace.CurrentCamera
local set = TweenInfo.new(5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0)
local target = {CFrame = workspace.[YOURPARTSNAME].CFrame}
-- Create the tween
local tweenstart = tweenService:Create(cam, set, target)
-- Play the tween
tweenstart:Play()
end)
And you’re done! Keep adding on to the system to make your on amazing tween system!
If anybody makes a product with this please let me know I’d love to see it!
- Yes
- No
Thanks for reading, also feel free to ask for help!