Hello Guys!
Im making a boss for a 2D spaceship shooter game and the boss’s moveset has a move when the boss releases a mine and the mine has a radius and I would like to put a danger sign picture above the radius which blinks faster and faster as the time running out and the mine blows up.
I hope you can understand guys what I would like to do.
Thank you for your help!
try something like:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class just_to_try : MonoBehaviour
{
public int ShorteningTime;
MeshRenderer rndr;
bool bossSpecialAttack ;
public int time=x;
// The materials that you will use:white and the normal warning sign
public Material white;
public Material warningSign;
void Start ()
{
rndr=GetComponent<MeshRenderer>();
}
void Update()
{
if(bossSpecialAttack==true)
{
rndr.Material=white;
WaitForSeconds(x);
x=x-ShorteningTime;
rndr.Material=warningSign;
WaitForSeconds(x);
x=x-ShorteningTime;
//use loops for shorter code, I couldn't write it becuse I don't know how to .
}
}
}