Created by David Fraj 2016-02-23 View revision File stone.cs Added Side-by-side diff More Ignore whitespace Hide word diff +using UnityEngine; +using System.Collections; + +public class Stone : MonoBehaviour { + + //Creamos una variable, para establecer cuando la piedra morira + private const float yDie=-30f; + + + // Use this for initialization + void Start () { + + } + + // Update is called once per frame + void Update () { + //Si la posicion y llega a ser menor que el valor donde debe morir, destruimos + if(transform.position.y < yDie){ + //gameObject es el propio object asociado. + Destroy (gameObject); + } + } +}