https://www.youtube.com/watch?v=J_Gd20JKT9Q
-------------------------------------------------------------------------
------SCRIPT DE C# PARA CREAR UNA CAMARA UN GAMEOBJECT UN CUBO AL QUE ASOCIAMOS UNA CAMARA Y QUE LA ACTIVAMOS AL APRETAR LA TECLA -D-
---------------------------------------------------------------------
---------------------------------------------------------------------------
----using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CREACAMARAALAPRETARAOD : MonoBehaviour
{
public GameObject retra, pico;
void Update()
{
// if (Input.GetKey(KeyCode.D))
if (Input.GetKeyDown(KeyCode.D))
// if (Input.GetButton(KeyCode.D))
//if (Input.GetButton("Fire3") )
// if (Input.GetKeyDown(KeyCode.Alpha2))//////original
{
retra.SetActive(true);//original
pico.SetActive(false);//original
}
if (Input.GetKeyDown(KeyCode.A))
{
retra.SetActive(false);
pico.SetActive(true);
}
if (Input.GetKeyDown(KeyCode.W))
{
retra.SetActive(false);
pico.SetActive(true);
}
if(Input.GetKeyDown(KeyCode.S))
{
retra.SetActive(false);
pico.SetActive(true);
}
}
}
No hay comentarios:
Publicar un comentario