Noticias

¡RECUERDA QUE SI ERES UN NUEVO USUARIO, DEBES PRESENTARTE PARA PODER PUBLICAR MENSAJES! | TENEMOS CANAL OFICIAL DE TELEGRAM: t.me/unity3dspain

Ayuda con el movimiento

Iniciado por adiamaq, Octubre 15, 2017, 02:36:40 AM

Tema anterior - Siguiente tema
Octubre 15, 2017, 02:36:40 AM Ultima modificación: Octubre 15, 2017, 02:08:58 PM por adiamaq
Hola chicos, soy nuevo en el foro. Estoy siguiendo un tutorial algo antiguo de unity y no se me mueve el cubo, alguien sabe por que?
 
Le he aplicado este script
 

using UnityEngine;
public class Mover : MonoBehaviour {
    float deltarotation = 30f;
    // Use this for initialization
    void Start ()
    {
        
    }
    
    // Update is called once per frame
    void Update ()
    {
        
    }
    void rotate()
    {   
        if(Input.GetKey(KeyCode.Q))
        transform.Rotate(new Vector3(0f, -deltarotation, 0f) * Time.deltaTime);
        else if (Input.GetKey(KeyCode.E))
            transform.Rotate(new Vector3(0f, +deltarotation, 0f) * Time.deltaTime);
        
     }
}

 
 

Cita de: adiamaq date=1508027800alguien sabe por que?
   


 


void Update ()
{
}

 
 

has creado la funcion rotate (void rotate)
 
pero no la llamas en ningun lado
 
prueba dentro de "Update" a llamarla, pon:
 

void Update() {
   rotate();
}

 
 

Si te presentas como es debido en la Comunidad, te podremos ayudar mejor. 

El tutorial lo estas siguiendo, pero no estás entendiendo nada de nada, es evidente.

Etiquetas: