- Home /
I already know the answer
How can I make a Dropdown option to be converted on a text to appear somewhere?
I want to choose a Dropdown option and be able to appear in another text and I select the option,I saw that with an InputField you need to convert it to a int variable and then to a string but I don't know to make it with a dropdown option,I think that I'll probably have to use arrays but I am not sure,can someone help me? I will put my code here so then you can see what I tried so far: using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;
public class DropdownToText : MonoBehaviour {
public Dropdown dropdown;
public Text placeholderText
public void TurnToText()
{
int t = Convert.ToInt32(dropdown.text);
Debug.Log(t.ToString());
}
}
PS:I am a beginner
Follow this Question
Related Questions
Get Dropdown Index value based on text value using Where c# filter 1 Answer
Why is my dropdown not able to control my game countdown time? 1 Answer
Spawn meshes to scene via dropdown UI button 2 Answers
Populate a dropdown dynamically from an array of objects REST API response 0 Answers
Creating a dynamic dropdown menu based on active GameObjects 0 Answers