How to fill a circle image by every second
Hi! I came back with a project for fun but i need help. Every time i press build is showing to me this error:
NullReferenceException: Object reference not set to an instance of an object AceDeCeas.Update () (at Assets/Scripts/AceDeCeas.cs:23)
Here you have my source
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class AceDeCeas : MonoBehaviour {
float time=0;
public Image secundar;
public Image minutar;
public Image orar;
public Slider slider1;
void Start () {
secundar = GetComponent<Image> ();
minutar= GetComponent<Image> ();
orar = GetComponent<Image> ();
slider1 = GetComponent<Slider> ();
secundar.fillAmount = 0;
}
// Update is called once per frame
void Update ()
{time += Time.deltaTime;
secundar.fillAmount = Mathf.Clamp (time, 0, 1);
}
}
First I wanted to make something to work with a slider but still error was showing.
I'll really appreciate the help :)
Serju
Umm is attached by my canvas group I think. I'll come back later to give you the answer. I'm away from my pc for moment :)
Soo...... $$anonymous$$y script is attached to canvas and Image type is filled :) I think if I will attach the script to image it'll work :)
Your answer
Follow this Question
Related Questions
Health Bar Not Working 1 Answer
Button calls itself numerous times 0 Answers
adjust image size with mouse 0 Answers
How to use the results of a dice roll? 2 Answers
How do i Instantiate sub-Points with in Multiple Points?? 0 Answers