How would I make a gui like this?

I want to make a gui like shown in this video but for a main menu. How do I make gui sway like this when moving the camera.

look at the mess I did

local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")

local Frame = script.Parent -- change it
local FramePosition = Frame.Position
local FrameOffset = FramePosition

local X, Y = {["Goal"] = 0, ["Tween"] = nil, ["Value"] = Instance.new("NumberValue")}, {["Goal"] = 0, ["Tween"] = nil, ["Value"] = Instance.new("NumberValue")}

RunService.RenderStepped:Connect(function(Deltatime)
	local MouseDelta = UserInputService:GetMouseDelta() * 0.5
	
	if X.Goal ~= MouseDelta.X then if X.Tween then X.Tween:Pause() end X.Goal = MouseDelta.X X.Tween = TweenService:Create(X.Value, TweenInfo.new(0.2), {["Value"] = MouseDelta.X}) X.Tween:Play() end
	if Y.Goal ~= MouseDelta.Y then if Y.Tween then Y.Tween:Pause() end Y.Goal = MouseDelta.Y Y.Tween = TweenService:Create(Y.Value, TweenInfo.new(0.2), {["Value"] = MouseDelta.Y}) Y.Tween:Play() end
	
	FrameOffset = UDim2.fromOffset(
		X.Value.Value,
		Y.Value.Value
	)
	
	--print(FrameOffset)
	--print(CameraRotation)
	
	Frame.Position = FramePosition + FrameOffset
end)
7 Likes

There’s a great module that you can use called CameraShaker.

thank you very much, I will use it

Works perfectly, Thank you very much

robloxapp-20221120-1037081.wmv (1.1 MB)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.