generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: GUI Animations

Previous Thread :: Next Thread 
LordZaptos is not online. LordZaptos
Joined: 30 Oct 2013
Total Posts: 69
16 Apr 2014 03:05 PM
Right. No error in output. Nothing in output. I want to cry. qq

local button = script.Parent
local bounce = false
local Alpha = script.Parent.Parent.Frame.Alpha
local Bravo = script.Parent.Parent.Frame.Bravo
local Charlie = script.Parent.Parent.Frame.Charlie
local Delta = script.Parent.Parent.Frame.Delta
button.MouseButton1Up:connect(function()
if bounce == true then return end
bounce = true
if Alpha.Position == UDim2.new(0,20,0,20) then
for i = 1,25 do
Alpha.Position = Alpha.Position + UDim2.new(0.02,-4,0.02,-4)
Bravo.Position = Bravo.Position + UDim2.new(-0.02,4,0.02,-4)
Charlie.Position = Charlie.Position + UDim2.new(0.02,-4,-0.02,4)
Delta.Position = Delta.Position + UDim2.new(-0.02,4,-0.02,4)
button.BackgroundTransparency = button.BackgroundTransparency + 0.02
button.TextTransparency = button.TextTransparency + 0.04
wait()
end
end
------What?
if Alpha.Position == UDim2.new(0.5,-80,0.5,-80) then
local base = script.Parent.Parent.Parent.Center
local left = base.Left
local right = base.Right
print(base)
print(right)
print(left)
end
bounce = false
end)




Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
16 Apr 2014 03:07 PM
Put print("Lol hi") after every 4 lines, where it stops, we'll know where the error is.
Report Abuse
powertool is not online. powertool
Joined: 01 Feb 2008
Total Posts: 3771
16 Apr 2014 03:17 PM
So what's it supposed to do? Animate a GUI once you click the GUI?

Try button.MouseButton1Down.
What are you trying to do anyway?

--This replaces your thing at/near the top. Right below the bounce = true line, then down to the "Waht?". There's this thing called Tweening, it makes GUI animation painless.
if Alpha.Position == UDim2.new(0,20,0,20) then
Alpha:TweenPosition(UDim2.new(0.5, -100, 0.5,-100), 1, 0, 1, true)
Bravo:TweenPosition(UDim2.new(-0.5, 100, 0.5,-100), 1, 0, 1, true)
Charlie:TweenPosition(UDim2.new(0.5, -100, -0.5,100), 1, 0, 1, false)
Delta:TweenPosition(UDim2.new(-0.5, 100, -0.5,100), 1, 0, 1, false)
for i=1,25 do
button.BackgroundTransparency = button.BackgroundTransparency + 0.02
button.TextTransparency = button.TextTransparency + 0.04
wait(1/25)
end
end

--Shira
Report Abuse
LordZaptos is not online. LordZaptos
Joined: 30 Oct 2013
Total Posts: 69
16 Apr 2014 03:41 PM
Don't understand any of it. XD Mindblown. Thanks.
Report Abuse
powertool is not online. powertool
Joined: 01 Feb 2008
Total Posts: 3771
16 Apr 2014 03:45 PM
All I did was tween your GUI over the period of a second over the full movement you were doing the laggy way, so I optimized that.

--Shira
Report Abuse
LordZaptos is not online. LordZaptos
Joined: 30 Oct 2013
Total Posts: 69
16 Apr 2014 04:26 PM
Can you explain it? My goal isn't to just put stuff together, I want to understand it, as well.
Report Abuse
LordZaptos is not online. LordZaptos
Joined: 30 Oct 2013
Total Posts: 69
19 Apr 2014 05:05 AM
Alpha:TweenPosition(UDim2.new(0.5, -100, 0.5,-100), 1, 0, 1, true)

the "1, 0, 1, true". Can someone explain that?
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
19 Apr 2014 07:10 AM
Let's look at this, shall we:

a = 1 --First 1
b = 0
c = 1 --Second 1
d = true

a is the EasingDirection enum "Out". This just applies the tweening normally. If we changed a to 0, it would apply the tweening backwards. If we changed a to 2, it would firstly tween backwards, then normally.
b is the EasingStyle enum "Linear". The linear enum determines the speed to get to the endPosition, depending on what c is equal to. (So c is the time it takes to get to the destination.
d is just an override value. If it's true, you can apply another tween to the gui object, while the other one is taking place. It's default value is false, which means you can't apply other tweens to that object while that tween is in place.

Further reading:
http://wiki.roblox.com/index.php?title=EasingDirection_(Enum)
http://wiki.roblox.com/index.php?title=EasingStyle_(Enum)
http://wiki.roblox.com/index.php/TweenPosition_(Method)

Here's my siggy... Done.
Report Abuse
Spongocardo is not online. Spongocardo
Joined: 06 Sep 2008
Total Posts: 2843
19 Apr 2014 07:11 AM
I forgot a bracket at the end of the second paragraph, I'm such a noob. xD

Here's my siggy... Done.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image