Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Temas - frighten98

#1
General (Antiguo) / Necesaria ayuda con Javascript
Junio 24, 2016, 08:25:35 PM
Hola a todos, me llamo Javi y estoy teniendo un pequeño problema con un script, concretamente con un if, adjunto una imagen.
 
Probablemente sea uno de mis grandes fallos tontos, pero ahí mismo lo teneis.
 

(inserto también el script)
var curHealth : int = 100;
var maxHealth : int = 100;
var healthtext : GUIText;
var regenActive;
var isNotDead=true;
 
function Update () {
 
    healthtext.text = curHealth + "%";
 
    if(curHealth < ) {
        curHealth = ;
    }
 
    if(curHealth > 100) {
        curHealth = 100;
    }
 
    if(Input.GetKeyDown("e")) {
        curHealth -= 10;
    }
}
function OnTriggerEnter(other : Collider){
    if (other.tag == "DeadZone"){
        curHealth -= 500;
        isNotDead= false;}
    if (curHealth < 100 || (other.tag == "PickHealth")){
        curHealth += 50;}
    if (other.tag == "Fire"){
        curHealth -= 10;}
}
    function Start () {
        if isNotDead=false; {
            Destroy(gameObject);
        }
    }

 
#2
Soy principiante en cuanto a programación se trata , y estoy recibiendo el error del título en el siguiente script : function OnGUI(){    if(Input.GetKeyDown(KeyCode.O)){
    
        Cursor.visible = false;
        Cursor.lockState = true;        
    }
    GUI.Box(Rect(Screen.width-300,0,300,20), "Press P/O To show/hide Cursor");
}
function Update(){    if(Input.GetKeyDown(KeyCode.P)){
    
        Cursor.visible = true;
        Cursor.lockState = false;
            
    }}Y no se de que clase de error se trata , lo siento si me equivoqué de categoría  .PD: Uso Unity 5