Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

it keeps saying "error CS1002: ; expected", I looked through my code and cant find where i need it

I am new to coding with c# in unity and am trying to animate an object in unity, but its saying that I need a semicolon but I cant find where I need one. this is my code

{
  public GameObject arm;
  public float time = 0f;
  public bool timedone = false;
  void Update()
  {
     if(time == 1f)
     {
         timedone = true;
     }
     if (Input.GetButtonDown("Fire1"))
     {
         arm.GetComponent<Animator>().Play("New Animation");
     }
     else
     {
         if(!timedone)
         {
             time += Time.deltaTime;
         }
         if (timedone)
          {
            arm.GetComponent<Animator>().Play("New State");
            Timereset()
          }  
      }
  }
  void Timereset()
  {
   time == 0f; 
  }
}

if you can help me I would be so grateful

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

In else condition ,

Timereset() doesn’t have ; there should be Timereset();

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading