Alguien me puede decir si falla algo en este script que estoy haciendo tal como pone en un tutorial para encender luces y apagarlas dentro de Unity?
Está adjunto:
.Código:#pragma strict. Var myLight : Light;. Var myLight1 : Light;. Function Start(){. MyLight = Light. FindObjectOfType(typeof(Light));. }. Function Update () {. If(Input. GetButtonDown(Fire1)){. MyLight, enabled =.myLight, enabled;. MyLight1.enabled =.myLight, enabled;. }. }
Ese seria él código, pero solo hace fallar y no entiendo el motivo.
-- IMÁGENES ADJUNTAS --
![]()