I have two objects. when they touch each other they stars to glow. but when they are separated they don’t should not completely become unglowing(Not glowing). They should gradually decrease there glowness until it becomes zero. How can I achieve this with Animation ?
I just started learning Unity (Self study and YouTube) 4~5 days ago so i am really noob
here is what I have done until now.
private void OnCollisionEnter(Collision other) {
if(other.gameObject == player.gameObject) {
anim.SetFloat("Direction",1);
anim.SetBool("touching",true);
anim.Play("Heat");
}
}
private void OnCollisionExit(Collision other) {
if(other.gameObject == player.gameObject) {
anim.SetFloat("Direction",-1);
anim.SetBool("touching",false);
anim.Play("Heat");
}
}
This give me what I partially excepted result but objects immediately glow to full intensity and then they dim out but I don’t want then to glow to full intensity.
PS: sorry for my Bad English. its not my native language