- Home /
blinking button text
I have recently started creating my first game and for my first task I want to create a flashing start game button. I have created C sharp code, but its not working and i'm not sure how to get it right as I am also new to C sharp.
Here is the button animation I want to achieve: http://codepen.io/DTcode20/pen/XNopjv
Here is the C sharp Code I have:
using UnityEngine; using System.Collections; public class menu_button : MonoBehaviour { public float timer; // Use this for initialization void Start () { } // Update is called once per frame void Update () { timer += Time.deltaTime; if (timer >= 0.5) { gameObject.GetComponent <menu_start_button> ().enabled = true; } if (timer >= 1) { gameObject.GetComponent <menu_start_button> ().enabled = false; timer = 0; } } }
I would greatly appreciate help with this
Thanks
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
changing animations on an object without the script. 0 Answers
How do I play legacy animations properly in Unity C# 1 Answer