Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by G.A.B.E. · Jan 13, 2014 at 10:39 PM · c#error

Help with an error urgent

Basically, I have been trying this thing for ages and i think it might almost be working. I'm VERY new to unity and this is one of my first projects. I keep getting errors in my script but even when i fix it there still is no change? Here is my error: "Assets/Scripts/Pill/PillEnable.cs(33,30): error CS0119: Expression denotes a type', where a variable', value' or method group' was expected"

And here is my text:

 void Update () 
     {
         if (Input.GetKeyUp (KeyCode.E))
             Colliderr ();
         if (Input.GetKeyUp (KeyCode.E))
             Rendererr ();
         if (Input.GetKeyUp (KeyCode.E))
             FPS ();
         if (Input.GetKeyUp (KeyCode.E))
             Follower ();
     }
 
     void Colliderr()
     {
         StartCoroutine(Collider());
     }
     IEnumerator Collider()    
     {    
         //This is a coroutine
         GetComponent<CapsuleCollider>().enabled = false;

"Here" yield return WaitForSeconds (20); //Wait one frame GetComponent().enabled = true; }

     void Rendererr()
     {
         StartCoroutine(Render());
     }
     IEnumerator Render()    
     {    
         //This is a coroutine
         GetComponent<MeshRenderer>().enabled = false;

"Here" yield return WaitForSeconds (20); //Wait one frame GetComponent ().enabled = true; }

     void FPS()
     {
         StartCoroutine (FPSC ());
     }
     IEnumerator FPSC()
     {    
         //This is a coroutine
         GetComponent<PlayerController>().enabled = false;

"Here" yield return WaitForSeconds (20); //Wait one frame GetComponent().enabled = true; }

     void Follower()
     {
         StartCoroutine (Follwer ());
     }
     IEnumerator Follwer()
     {    
         //This is a coroutine
         GetComponent<SphereFollower>().enabled = true;

"Here" yield return WaitForSeconds (20); //Wait one frame GetComponent().enabled = false; } }

I have put the word "Here" is the lines that have the same error. Any help at all would be great!

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by tanoshimi · Jan 13, 2014 at 10:40 PM

  1. For future reference, you don't need to insert "here" in your code - just paste the whole script and the error message and we can see from the line numbers where the problem is ;)

  2. yield return WaitForSeconds (20); should be yield return new WaitForSeconds (20);

Comment
Add comment · Show 2 · 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 G.A.B.E. · Jan 24, 2014 at 09:30 PM 0
Share

Thanks for the help, I can't believe how picky C# is o.0 I woulda voted your answer up, but i don't have enough rep yet :/

avatar image tanoshimi · Jan 24, 2014 at 10:03 PM 0
Share

You're welcome. Also, you might not want to write "urgent" in your question title if it's going to take you 10 days to check for responses...

avatar image
0

Answer by Sundar · Jan 13, 2014 at 10:44 PM

Add new in front of WaitForSeconds() like

 yield return new WaitForSeconds (20);
Comment
Add comment · 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

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

20 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

Related Questions

Multiple Cars not working 1 Answer

Argument out of range. 1 Answer

NullReferenceException problem 2 Answers

Errors with script using Javascript. 2 Answers

Error with 'public' on script for helicopter 1 Answer


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