Skip to content

Instantly share code, notes, and snippets.

@danielgc
Created September 15, 2017 19:20
Show Gist options
  • Save danielgc/ed1a829c870f256890b9a12a9629783d to your computer and use it in GitHub Desktop.
Save danielgc/ed1a829c870f256890b9a12a9629783d to your computer and use it in GitHub Desktop.
FighterBulletController.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FigtherBulletController : MonoBehaviour {
public float bulletSpeed = 18f;
// Use this for initialization
void Start () {
this.GetComponent<Rigidbody2D>().velocity = new Vector3 (0, bulletSpeed, 0);
}
// Update is called once per frame
void Update () {
// monitorear para desaparecer bala
if (transform.position.y > 10.5) {
Destroy (gameObject);
print ("Bala perdida");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment