Unity Spain

Post Antiguos => General (Antiguo) => Mensaje iniciado por: Chusikito en Mayo 21, 2018, 05:06:38 PM

Título: Rotar objeto, Script.
Publicado por: Chusikito en Mayo 21, 2018, 05:06:38 PM
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);
        }
    }
}

 
(//%3CfileStore.core_Attachment%3E/monthly_2018_05/5b02e07c69d6f_Capturadepantalla2018-05-21alas17_04_15.png.30818443601b60c86a5531986d702d65.png)
Título: Rotar objeto, Script.
Publicado por: lightbug en Mayo 21, 2018, 05:42:47 PM
Hola, fijate si el archivo tiene el mismo nombre de la clase (ExampleRotate) , es necesario.
Título: Rotar objeto, Script.
Publicado por: Chusikito en Mayo 21, 2018, 05:49:58 PM
Gracias!!