• 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
1
Question by Makiavel · Nov 01, 2012 at 11:51 AM · errorcoroutineupdate

Update() cannot be a coroutine

I keep getting this error: Update() cannot be a coroutine

But when I click it, it doesn't even show the script, where I have a mistake, so I don't even know what's wrong. Is there any tutorial for this type of mistake or something like that?

Comment
Add comment · Show 1
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 Fattie · Nov 01, 2012 at 02:16 PM 0
Share

strongly suggest unityGE$$anonymous$$S.com for explanation of Invoke() which is far simpler way to do timers.

1 Reply

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

Answer by Montraydavis · Nov 01, 2012 at 12:11 PM

All you have to do is create another function, and then put your coroutines in that function, and that function inside of Update :D You can't have coroutines in Update.

It's blocked by Unity for performance / security reasons I believe.

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 Makiavel · Nov 01, 2012 at 12:47 PM 0
Share

God, I just realized how stupid the mistake was. I copied a part of the script into the update, and it had WaitForSeconds in it) Deleted it and it works fine, sorry to bother you)

avatar image Montraydavis · Nov 01, 2012 at 03:20 PM 0
Share

You are not "bothering" . I am happy to assist you at any time . Thanks for you interest in Unity3D :) Glad this helps you.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

11 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

Related Questions

Coroutine Continue Failure when using StopCoroutine 2 Answers

How to make a spawner wait for x seconds? 2 Answers

inconsistent results calculating the distance moved by an object 1 Answer

[HELP!!] Files all missing while I update the version from Unity 2018.3.12f1 to Unity 2019.1.4f1 0 Answers

Unity 2020.2 crashes when loading my Unity 2020.1 project 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges