- Home /
Question by
truffledude12 · Dec 20, 2017 at 06:55 PM ·
c#scripting problemscript.unity 5.2hsbcolor
Script for a hue rainbow scroll on the material
I have the HSBColor plugin and have gotten a rainbow effect on my walls, but my concern now is to have the same sort of effect, but instead of going through the colors of the rainbow, scrolling through hues from white to black and grey and such, any ideas?
Comment
Answer by MKGPlayz · Jun 10, 2020 at 12:39 AM
Here you go
using UnityEngine;
public class Hue : MonoBehaviour
{
public float Speed = 1;
private Renderer rend;
void Start()
{
rend = GetComponent<Renderer>();
}
void Update()
{
rend.material.SetColor("_Color", HSBColor.ToColor(new HSBColor(Mathf.PingPong(Time.time * Speed, 1), 1, 1)));
}
}
Your answer
Follow this Question
Related Questions
Sorting a list based of a variable 1 Answer
How can i List objects by name but also in small text or big text or any kind ? 1 Answer
How can i make an entrance and exit in this maze ? 1 Answer
How can I animate linerenderer lines over time ? 1 Answer
How can i find a thirdpersoncontroller hand and attach object to the hand ? 1 Answer