I am developing an android game where I want to fade in the enemy as they spawn, The enemies are using standard (Specular shader), rendering mode is set it Fade ,prefabs have 0 alpha in albedo .To do this i use the following code
Enemy fadeIn
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemySetAlpha : MonoBehaviour {
public Color enemyMesh;
public float fadetime = 255;
// Use this for initialization
void Start () {
enemyMesh = GetComponent<SkinnedMeshRenderer> ().material.color;
}
// Update is called once per frame
void Update () {
fadeIn (fadetime);
}
void fadeIn(float time)
{
enemyMesh = new Color (1, 1, 1, 0 + (fadetime*Time.deltaTime));
}
}
The problem I am facing is the the enemy that script increases the alpha but the albedo alpha is still 0 thus not fading in the enemy.