Hi, i have one question . How to show a letter on the screen (like it was in slender). I know how to “take” a letter from the ground ( i just made a script to press “f” and then destroy gameobject and add point page1 += 1 then script check if page1= 1 ) and after that to show my letter on the screen. how to do it?
You could have it as a GUITexture that is disabled until picking it up. Then it shows on screen on top.
// Drag all letter objects here. You can also use an array.
public GUITexture letter1, letter2, letter3;
Dictionary <string, GUITexture>dict = new Dictionary<string, GUITexture>();
GUITexture guiActive;
void Start(){
//Put all GUITexture with a name in the dictionary
// Disable them all
}
void Update(){
if(guiActive != null && Input.GetKeyDown(Keycode.R)){
guiActive.gameObject.SetActive(false);
guiActive = null;
}
}
void OnCollisionEnter(Collision col){
if(col.gameObject.Tag == "Letter"){
if(dict.Contains(col.gameObject.name)){
dict[col.gameObject.name].gameObject.SetActive(true);
guiActive = dict[col.gameObject.name];
}
}
}
Use the name to store them in the dictionary like this:
dict.Add(letter1.name,letter1);
It needs to be tried though…pressing R will close the GUI.