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 Wesley21spelde · Jan 18, 2021 at 12:54 PM · photonplayerprefsinputfieldname

player name input field

hey guys how can i change this

 PhotonNetwork.player.name = GUILayout.TextField(PhotonNetwork.player.name);

to this

 PhotonNetwork.player.name = UiTextField.text = (PhotonNetwork.player.name);

it does not work this way i vant change the text input? thanks

Comment
Add comment · Show 4
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 xxmariofer · Jan 18, 2021 at 01:26 PM 0
Share

What is UiTextField class? a custom class? Or the TextField class of unity?

avatar image jackmw94 · Jan 18, 2021 at 02:52 PM 0
Share

What's your end goal here? What sort of behaviour are you looking to make? :)

avatar image Wesley21spelde jackmw94 · Jan 19, 2021 at 08:56 AM 0
Share

it is i think a public class. i got this code by following a tutorial and the PhotonNetwork.player.name = GUILayout.TextField(PhotonNetwork.player.name); was used for player name. but it was standard Gui button i beleve unity build in..

like this..

GUILayout.BeginArea(new Rect(0, 0, Screen.width, Screen.height)); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); GUILayout.Label("Username:"); PhotonNetwork.player.name = GUILayout.TextField(PhotonNetwork.player.name);

but i wanted to change the GUI buttons to UI Buttons and the new button did go well but when in tried changing the GUILayout.TextField. from this ... PhotonNetwork.player.name = GUILayout.TextField(PhotonNetwork.player.name); in to this PhotonNetwork.player.name = UiTextField.text = (PhotonNetwork.player.name); with an GameObject/UI/Input Field .it did work no errors but the problem is i cant change the text annymore its in this part i think..UiTextField.text = (PhotonNetwork.player.name); becouse the other one is like this... GUILayout.TextField(PhotonNetwork.player.name); without the = but removing it didn`t work and i dont know how to do it

thanks by the way for helping......Wesley

avatar image Llama_w_2Ls Wesley21spelde · Jan 19, 2021 at 09:15 AM 0
Share

If you have a reference to your input field, you can access its text property like so. I'm assu$$anonymous$$g you're using UnityEngine.UI:

 public InputField inputField;
 
 void Start()
 {
      inputField.text = PhotonNetwork.player.name;
 }

I believe that you're having issues because you're setting the text component of the input field in the Update.

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

124 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

Related Questions

Unity Photon Name-Tag Problem 2 Answers

Multiple Buttons To Use One Text Input Field 1 Answer

DontDestroyOnLoad and Photon, players not visible 1 Answer

How to get random names that will be the same later on 0 Answers

how to put the name of a car ??? 0 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