Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 /
This question was closed Dec 29, 2021 at 08:43 AM by Deksover for the following reason:

Problem is not reproducible or outdated

avatar image
0
Question by Deksover · Dec 27, 2021 at 04:05 PM · coroutinestrings

Sending 2 strings to coroutine does not seem to work

Hi All, I have a method that has two strings in it,

 public void GetValues(string emailText, string passwordText)
 {
     Debug.Log(emailText + passwordText);
     StartCoroutine(Send(emailText, passwordText));
 }

Debug.Log works fine, but when I pass it to my Coroutine,

 private IEnumerator Send(string emailText, string passwordText)
 {
     Debug.Log(emailText + passwordText);
 }

I get nothing in my Debug.Log. Could not figure out what is wrong for hours Please help!

Comment
Add comment · Show 2
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 Hellium · Dec 27, 2021 at 05:15 PM 0
Share

Is the gameObject holding the script enabled? A disabled object can't run coroutines.

Is the content of the Send method only what you've provided?

avatar image Deksover Hellium · Dec 27, 2021 at 05:21 PM 0
Share

Yes, the gameObject is enabled. Otherwise, the GetValues Method would not work.

The rest of the method goes below Debug.Log(). Here it is:

private IEnumerator Send(string emailText, string passwordText) { Debug.Log(emailText); WWWForm form = new WWWForm(); form.AddField("WelcomeMSG", "DD"); WWW www = new WWW("https://dasomsaassist.com/", form); yield return www; if(www.error !=null) { Debug.Log("error: " + www.error); yield break; } Debug.Log("Answer: " + www.text); }

2 Replies

  • Sort: 
avatar image
0

Answer by heislerc0 · Dec 28, 2021 at 10:57 PM

Unity tends to group logs that are the same. In your console do you see something like this?

 emailpassword (2)

Your coroutine may be logging and being grouped with the first one. Sorry if that doesn't help, nothing jumps out as wrong to me with the code.

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
avatar image
0

Answer by Deksover · Dec 29, 2021 at 08:42 AM

Hi. Thank you for your answers. The issue was in the main class where I called the Coroutine.

It did not start from the main thread so it did not work. The issue is fixed now.

Without the full code provided, it was impossible to understand what was wrong, my bad.

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

Follow this Question

Answers Answers and Comments

143 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 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 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

Backspace typewriter effect 1 Answer

Only executing the last coroutine 1 Answer

StartCoroutine_Auto can only be called from the main thread. 1 Answer

How to start a coroutine from another script? 1 Answer

How do I do something after multiple coroutines finish? 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