how to get dice number in ui text
actually i m new in unity so,i dont knw how to update ui text.please help me guys
Answer by hexagonius · Jan 15, 2016 at 02:46 PM
The component Explained: http://docs.unity3d.com/ScriptReference/UI.Text.html
Code you can attach to the GameObject with the TextElement
using UnityEngine;
using UnityEngine.UI;
public class ChangeText : MonoBehaviour {
void Start(){
GetComponent<Text>().text = "dice number";
}
}
What do you mean by "getting it"? I read a six and know about the others.
i knw tht but how to print tht particular side number on ui text by seing this type of dot
Answer by Rexx1011 · Jan 15, 2016 at 03:07 PM
Maybe you could apply a tag to each side, then retrieve that tag after the dice is "rolled". I'm new to Unity and I've only completed my first game in it last night so I'm not sure, but that's how I would initially approach it but there may be a better way to do it.
can u plz recommended some video to do tht i really dnt knw how to do it
Uhm.. sure I would suggest this one for learning how to retrieve a tag: http://unity3d.com/learn/tutorials/projects/roll-a-ball/collecting-pick-up-objects?playlist=17141
Child object not rotating as parent
plz checkout link:- https://www.youtube.com/watch?v=58ODzgALHjs
Your answer
Follow this Question
Related Questions
Canvas Text Help 0 Answers
Font looks very bad (not blurry) 0 Answers
How To Load TTF Font From External File 0 Answers
Resize font of all texts to the same value 1 Answer
Problems with Canvas and ui elements scaling at runtime 0 Answers