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 gheeler · Nov 20, 2014 at 12:40 PM · gui4.6

[4.6] Input field password string value is ************

I have an input field whose content type is password. When I try to get the string from input field all it's giving me is a line of asterix'

 string _password = inputPassword.GetComponent<InputField>().text;

_password is "*"

What am I doing wrong here?

Comment
Add comment · Show 3
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 MrSoad · Nov 20, 2014 at 12:52 PM 0
Share

I'm guessing here, but if its type is password then I'm guessing that for security reasons the string is replaced with X's and the real password data is somewhere else.

avatar image gheeler · Nov 20, 2014 at 12:55 PM 0
Share

yeah seems to be, but I dont know where to get the actual password..

avatar image gheeler · Nov 20, 2014 at 01:27 PM 0
Share

thanks, I figuered out what I was doing wrong below

2 Replies

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

Answer by gheeler · Nov 20, 2014 at 01:14 PM

Found out what was going wrong. I had a public RectTransform which in the editor I assigned the child 'Text', not the actual input field because in previous betas there was no direct access to the .text property.

I changed it to the actual InputField object and accessing it through there works properly

Comment
Add comment · Show 1 · 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 shivam mukherjee · Jan 14, 2015 at 02:02 PM 0
Share

Hey, I am using 3d text for password using onscreen keyboard for my Android phone... I want my password to be in * type... Can you please help me :)?

Thanks in advance :)

avatar image
0

Answer by troien · Nov 20, 2014 at 01:23 PM

When I try this, I get the password instead of a lot of asterix. Are you sure you are not overwriting it somewhere?

To test this I have a empty Scene with a Canvas and A child. This child has a RectTransform, Canvas Renderer, Text and a InputField component.

Then I also added the following script:

 using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;
 
 public class Test : MonoBehaviour
 {
     void Update()
     {
         Debug.Log(GetComponent<InputField>().text + " : " + GetComponent<Text>().text);
     }
 }

The result in the console then looks like this:

 YourPassword : ************

(Unity 4.6.0f2)

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

30 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

Related Questions

4.6 Gui anchoring a ui element to a Game Object 2 Answers

Prefab as a Sprite 0 Answers

v4.6 UI Element's Positioning Incorrect 1 Answer

Unity GUI 4.6 stops animation 0 Answers

Render new UI objects on top of Legacy GUI 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