- Home /
Question by
MTDues · Aug 19, 2017 at 02:26 AM ·
c#scripting problemscriptingbasicsshader programming
Dissolve shader script little proplemo, help me
Hello guys
ive got my shader working fine but there is a code named "Time" that code basicly when i open game it dissolves my character by time i want to reverse this, make it spawn my character in a cool waym""""
i dont want the character to dissapear i want it to appear with the dissolve effect i dont know but it seems simple when i think about it, just a Reverse but dont know how to that
so here is the code guys help me
using UnityEngine;
using System.Collections;
public class Timed : MonoBehaviour
{
public float m_fDestruktionSpeed = 0.1f;
public Material m_Mat;
public float m_fTime;
void Start () {
m_Mat = GetComponent<Renderer>().material;
}
void Update () {
m_fTime += Time.deltaTime * m_fDestruktionSpeed;
if (m_fTime >= 1.5f)
m_fTime = 0;
m_Mat.SetFloat("_Amount", m_fTime);
}
}
Comment
IN THE SHADER DETAILS PICTURE friendly note
if Amount going to 1, it makes the character Dissolving "Disapeared" 0 makes character appear