c1der
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 16 |
|
|
| 26 Jan 2017 06:07 PM |
it seems like an easy task but can anyone help me with making a colour changing block that transitions smoothly, not instant random colours, like a mix of about 3 colours that transition to one another slowly over time.
thanks |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 26 Jan 2017 06:09 PM |
| A part doesn't support Color3. What you can do is cover it up with a SurfaceGui. |
|
|
| Report Abuse |
|
|
c1der
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 16 |
|
|
| 26 Jan 2017 06:10 PM |
| sorry I am a bit new to scripting and have only started about a day or two ago. could you explain it a bit more? my problem is I want a ScreenGUI to loop a smooth color transition between the colors bright blue and purple |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 26 Jan 2017 06:13 PM |
The thread said block, don't mislead next time ;)
If it's a GuiObject with any Color3 property, you can use lerp (probably too advanced for you).
for i = 0, 1, 0.1 do script.Parent.BackgroundColor3 = script.Parent.BackgroundColor3:lerp(Color3.new(1, 0, 0), i) wait() do |
|
|
| Report Abuse |
|
|
c1der
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 16 |
|
|
| 26 Jan 2017 06:15 PM |
sorry i thought it would be the same with bricks and gui's. so how can i get the colors i want and is it a localscript or normal script? |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2017 06:16 PM |
while true do script.Parent.BrickColor = BrickColor.new('Really blue') wait(.05) script.Parent.BrickColor = BrickColor.new('Royal Purple) wait(.05) script.Parent.BrickColor = BrickColor.new('Plum') wait(.05) script.Parent.BrickColor = BrickColor.new('Royal Purple) wait(.05) script.Parent.BrickColor = BrickColor.new('Really blue') wait(.05) end
-- [[ Not super duper smooth, but it transitions. ]] -- |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 26 Jan 2017 06:17 PM |
BasePart = BrickColor GuiObjects, etc. = Color3
By getting the color you want, you can do: Color3.fromRGB(0, 200, 0) -- Blue
Here's the API for Color3. http://wiki.roblox.com/index.php?title=API:Color3 |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 26 Jan 2017 06:17 PM |
@bright
Extremely inefficient. Loops are the way to go. |
|
|
| Report Abuse |
|
|
c1der
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 16 |
|
|
| 26 Jan 2017 06:20 PM |
| i know i might be annoying, and this is why i came here, i am a complete noob to scripting, so i have no idea how to start it off, i dont know most keywords and what they do. basically i was asking for the full script that cycled through the colors and where to put the script, in ym screengui? sorry lol |
|
|
| Report Abuse |
|
|
c1der
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 16 |
|
|
| 26 Jan 2017 06:23 PM |
actually, i should be more clear, if this is the problem:
the color cycle is in a LoadClient which is a loading screen with a loading bar, and i want the background frame to do the cycle
|
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 26 Jan 2017 06:24 PM |
ScreenGui doesn't have Color3 changing properties. Use it on stuff like Frames, TextButtons, etc.
Try this (copy/paste in a LocalScript under Instances with a BackgroundColor3 property);
local Object = script.Parent local FirstColor = Color3.fromRGB(255, 0, 255) -- I already configured it for you (purple) local SecondColor = Color3.fromRGB(0, 170, 255) -- My favorite blue color (sky-ish blue)
while true do for i = 0, 1, 0.05 do Object.BackgroundColor3 = Object.BackgroundColor3:lerp(FirstColor, i) wait() end for i = 0, 1, 0.05 do Object.BackgroundColor3 = Object.BackgroundColor3:lerp(SecondColor, i) wait() end end |
|
|
| Report Abuse |
|
|
c1der
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 16 |
|
|
| 26 Jan 2017 06:26 PM |
| okay, thank you very much OAuth2! +1 to you, that's all i needed ty. sorry for being annoying haha |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 26 Jan 2017 06:26 PM |
| You're not annoying, this is a place where fellow scripters, new or experienced, help each other :) |
|
|
| Report Abuse |
|
|
c1der
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 16 |
|
|
| 26 Jan 2017 06:30 PM |
| just one last quick question, how can i slow it down but keep the smooth transitioning? i want to start off bright blue and gradually get purple, then go back to sky blue (loop) |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 26 Jan 2017 06:31 PM |
View this line right here: for i = 0, 1, 0.05 do
Change 0.05 to 0.01, or something even much lower, if you need to. |
|
|
| Report Abuse |
|
|
c1der
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 16 |
|
|
| 26 Jan 2017 06:38 PM |
| big help, thanks. now im just trying to find out how to add some sort of image of a palm tree png's going past the screen as it loads what im trying to do is make a Hotline Miami referenced game, here's a link to what im trying to recreate some how https://www.youtube.com/watch?v=Z_WtTC-Kd_E if that didnt work ############################################## remove X's |
|
|
| Report Abuse |
|
|