• 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 Jun 11, 2016 at 02:05 PM by YoungDeveloper for the following reason:

The question is locked til example of what have you tried is added to the question. "I only require a C# script from you" wont do here.

avatar image
0
Question by SirJosh3917 · Jun 10, 2016 at 12:09 PM · c#unity 5scripting problem

Unity 5.3 - How do you Grab textfrom InputField in C# Script?

A Quick Note

I have changed the description of what I'm doing so that it is easier to grasp the basic information. I am also a complete beginner at Unity, so please correct me if I go wrong anywhere.

The Topic

The question title is very broad, but the main goal is to get a user to enter their username in the first InputField, their email in the second InputField, and the chat server in the third InputField. The "chat server" is really just a folder consisting of text documents of which are logs.

The Goal

The goal for me is to have a C# script that when a button is pressed, it grabs the information from the 3 InputFields, and write to "D:[ChatServer]\log.txt" a join message, such as:"[Username] contacted at [Email] Joined!"

What I Require

I only require a C# script from you that just has to have the code for grabbing information from 3 InputFields when a button is pressed. It would be very nice of you if you would specify where to put and attach the script as well.

How the Project has been Setup

The project consists of a Canvas first being created using the UI within the unity editor. The first InputField created was the username, the second being the email, and the third being the chat server. Then a button was created, and attached to the button is a script that detects when the button has been pressed.

The Project's Looks

I have uploaded some images for you to look at, for reference. Image 1 - The Hierarchy: http://prntscr.com/bejy4n Image 2 - The First InputField [Username] : http://prntscr.com/bejyea Image 3 - The Second InputField [Email] : http://prntscr.com/bejyks Image 4 - The Third InputField [ChatServer] : http://prntscr.com/bejysr

My Apologies and Thanks

I thank you for your reply, as it might provide some light to my problem, and if you fixed the problem, my congratulations and thanks for you being a dedicated Unity user, and helping others just as you would like them to help you, and giving complete beginners at Unity a helping hand, even when their message doesn't quite make sense.

My apologies to all who think of my question to be very precise and demanding on the result, I am sorry for being rude, as I do not wish for myself to come off rude or demanding. I also apologize for my question coming off as some sort of "License Agreement" with sections, as I wouldn't like to have a simple question I am going to answer look like a license agreement.

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 jlmakes · Jun 10, 2016 at 03:00 PM 0
Share

This has been asked before, on both answers.unity3d.com and stackoverflow.com. Good luck!

avatar image SirJosh3917 · Jun 11, 2016 at 12:57 PM 0
Share

@jlmakes The thing is however, I made my InputField with the Unity UI Editor. I don't know how to rename it, if you could please tell me how, I'd be satisfied :)

1 Reply

  • Sort: 
avatar image
0

Answer by xXx12aithexXx · Jun 10, 2016 at 04:34 PM

you need to assign the the inputfield to a variable then you send the variable to the document.

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

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Unloading Broken Assembly | How to solve this !? 2 Answers

The spaceship acceleration script is good ? And how to use it with engine ? 0 Answers

[Newbie] Particle System not playing, C# (unity 5.5) 3 Answers

How to tell an operand "Once" or "Started to" 3 Answers

Adding existing script at run-time and changing it's properties 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