Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Serju · May 18, 2016 at 01:45 PM · c#unity 5imagefill

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

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image El__Nacho · May 18, 2016 at 03:01 PM 1
Share

Is this script attatched to the Image?

avatar image Serju El__Nacho · May 18, 2016 at 03:44 PM 0
Share

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 :)

avatar image El__Nacho · May 18, 2016 at 03:26 PM 0
Share

And is the Image Type filled or something other?

avatar image Serju · May 18, 2016 at 03:48 PM 0
Share

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 :)

avatar image Serju · May 18, 2016 at 03:49 PM 0
Share

It just worked. Thank you ! :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Serju · May 18, 2016 at 03:53 PM

As @El_Nacho said in comm I need to attach the script at component. Thank you man :)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image El__Nacho · May 18, 2016 at 04:06 PM 0
Share

No problem :)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

54 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges