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 GuyTidhar · Mar 28, 2012 at 02:07 PM · c#coroutinephoton

StartCoroutine not working for unknown reason

Well I know unity, C# and have been working on unity for several years but something very weird is going on with an attempt I make to call a coroutine.

 StartCoroutine("HandleNetworkWarnings");

is called within a case statement.

 private IEnumerator HandleNetworkWarnings()
 {
 ...
 }

is the coroutine.

The coroutine does not work and instead the log just prints the name of the coroutine in red to the console with the stack trace:

 UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
 UnityEngine.MonoBehaviour:StartCoroutine(String) (at C:\BuildAgent\work\842f9557127e852\Runtime\ExportGenerated\Editor\UnityEngineMonoBehaviour.cs:74)
 GameService:HandleNetworkWarnings(String) (at Assets\Scripts\NewScripts\BaseClasses\GameService.cs:766)
 GameService:OnConnectionStatusHandler(String) (at Assets\Scripts\NewScripts\BaseClasses\GameService.cs:734)
 XServiceListener:StatusCallback(String) (at Assets\Scripts\NewScripts\BaseClasses\XServiceListener.cs:109)
 PhotonListener:PeerStatusCallback(StatusCode) (at Assets\Scripts\NewScripts\ConnectionService\PhotonListener.cs:62)
 ExitGames.Client.Photon.EnetPeer:queueOutgoingAcknowledgement(NCommand)
 ExitGames.Client.Photon.EnetPeer:receiveIncomingCommands(Byte[])

I call other coroutines in the parallel case statement and it works fine.

I am wondering whether I stumbled upon some unity bug caused here. Note that the class is abstract, but that caused no issues until this one. Also, the call is made within a callback which is called by the photon listener (3rd party multiplayer solution).

Comment
Add comment · Show 6
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 Kryptos · Mar 28, 2012 at 02:32 PM 1
Share

IS this 3rd party multiplayer solution running in a separate thread? Coroutine (and AFAI$$anonymous$$ almost all UnityEngine methods wrapped around the internal Unity library) cannot be called outside the main thread.

avatar image GuyTidhar · Mar 28, 2012 at 02:53 PM 0
Share

Since other coroutines seems to have run, I don't think so. But I'll try to check.

avatar image Berenger · Mar 28, 2012 at 03:14 PM 1
Share

guyt : You should have asked that as a comment before doing an answer. Now my question is not viewed as unanswered.

$$anonymous$$e : Indeed. Are you destroying the object inbetween the call of the coroutine and it's execution ?

guyt : no, I do not.

avatar image GuyTidhar · Mar 28, 2012 at 03:35 PM 0
Share

thanks Berenger!

avatar image GuyTidhar · Mar 28, 2012 at 04:22 PM 0
Share

I ditched the coroutine and used a .NET timer.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

6 People are following this question.

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

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Photon: Switch Master Client 1 Answer

battle game networking Question 0 Answers

Cant Jump ?c# please 2 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