I’m trying to make two guis rotate and look at eachother, but I can’t seem to figure out how, I’m trying to make a battle system and nothing works, so what should I do?
You cannot make two GUIs face each other. You can only rotate them.
I know I wanna figure out how to rotate them at eachother
To rotate a GUI you just need the following script:
local TweenService = game:GetService("TweenService")
local Object = script.Parent -- The object you want to tween.
local tweenInfo = TweenInfo.new(
5, -- The time in seconds the tween takes to complete
Enum.EasingStyle.Linear, -- The tween style.
Enum.EasingDirection.Out, -- EasingDirection.
-1, -- How many times you want the tween to repeat. Making it 0 will mke it spin forever.
false, -- Make it true if you want it to be reversed, or keep it false if not.
0 -- Delay.
)
local Tween = TweenService:Create(Object, tweenInfo, {Rotation = 360}) --Creates the tween .
Tween:Play()
like this?
https://gyazo.com/fa97a8ed6c9c794e2b1e52cdde927e2a
local main = script.Parent
local f1, f2 = main.f1, main.f2
game:GetService("RunService").RenderStepped:Connect(function()
local pos1, pos2 = f1.AbsolutePosition, f2.AbsolutePosition
local direction = (pos2 - pos1)
local a1 = math.atan2(direction.Y, direction.X)
f1.Rotation = math.deg(a1)
f2.Rotation = math.deg(a1)
end)
Yes! thank you so much, I appreciate you
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.