About 9,530,000 results
Open links in new tab
  1. Unity - C# How to print the value of variable that its name is …

    Aug 20, 2021 · In unity - C# script; I want to print the value of variable (int, float , string or any var) that its name stored in string variable: for example: int Ronaldo = 7; int Messi = 10; string …

  2. Print String And Variable In Same Line - Unity Discussions

    Nov 10, 2013 · So I want to print the word ball and the variable to the console. For example, I want to print, “Ball2” to the console, but I want this line of code: Debug.Log(“Ball”(x));

  3. unity - How do I display a variable in a UI Text component?

    Jun 26, 2018 · as displayed in the other answer, you can use an interpolated string, using the $, like such. textComponent.text = $"Value is: {value}"; Here is a bigger example: int val; void …

  4. Scripting API: String - Unity

    Here are some basic uses of the String class. void Start() // prints hello. string s = "hello"; Debug.Log (s); // prints hello world. s = string.Format("{0} {1}", s, "world"); Debug.Log (s); // …

  5. The Three Ways To Display A Variable’s Value On The Unity UI

    Nov 30, 2022 · There are many ways to display a variable’s value on the Unity UI. The most common way is to use the Unity UI Text component. This will add a text field to your UI that …

  6. How to simply print a variable on screen? - Unity Discussions

    Mar 8, 2010 · I need to print the “rigidbody.velocity.magnitude” variable on the screen, in order to know its amount and then know how to modify other values on the base of that. I think the …

  7. How To Print To Console Unity? - ANSWERTICA

    Jan 6, 2025 · Here are three ways to do it: 1) Use the ‘print’ function to display a message or variable value directly in the console window. 2) Use the ‘Debug.Log’ function to print …

  8. Access script variable by the string of it's name unity

    Apr 10, 2021 · How can I access the value of x from the Data script from DataReader, keeping in mind that I am really looking for the ability to access arbitrarily named fields from Data by the …

  9. Accessing variable name with string input? : r/Unity3D - Reddit

    Aug 8, 2020 · string myString TextMeshProUGUI QuestText if ( a condition ) { myString = "Sentence1' } else if (another condition) { myString = "Sentence2' } QuestText …

  10. How to use Debug Log in Unity (without affecting performance)

    Mar 7, 2022 · The simplest way to print a message in the console in Unity is by using the Debug Log function, which takes a string value and displays it in the Console window. Like this: void …

  11. Some results have been removed
Refresh