Noticias

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

Rotar objeto, Script.

Iniciado por Chusikito, Mayo 21, 2018, 05:06:38 PM

Tema anterior - Siguiente tema
Mayo 21, 2018, 05:06:38 PM Ultima modificación: Mayo 21, 2018, 06:05:29 PM por pioj
Muy buenas, tengo problemas con un scripts. Me sale la siguiente ventana y no madeja añadir el script a la cámara ARcamera.
 
adjunto código también. Saludos y gracias por la ayuda! 
 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ExampleRotate : MonoBehaviour
{
    public GameObject objectRotate;
    public float rotateSpeed = 50f;
    bool rotateStatus = false;
    public void Rotasi()
    {
        if (rotateStatus == false)
        {
            rotateStatus = true;
        }
        else
        {
            rotateStatus = false;
        }
    }
    void Update()
    {
        if (rotateStatus == true)
        {
            objectRotate.transform.Rotate(Vector3.up, rotateSpeed * Time.deltaTime);
        }
    }
}

 

Hola, fijate si el archivo tiene el mismo nombre de la clase (ExampleRotate) , es necesario.


Etiquetas: