Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Bullet : MonoBehaviour {
- public GameObject BulletObject;
- public Rigidbody2D BulletBody;
- public float DestroyTime = .5f;
- public int Damage;
- void Start () {
- BulletBody.AddForce (new Vector2(Vector3.right.x, Vector3.right.y) * 1000);
- BulletObject.transform.position = GameObject.FindGameObjectWithTag ("PewThing").transform.position;
- }
- void Update () {
- if (DestroyTime > 0f) {
- DestroyTime -= Time.deltaTime;
- } else {
- Destroy (this.gameObject);
- }
- transform.Rotate(new Vector3(Input.GetAxis("Mouse Y"), Input.GetAxis("Mouse X"), 0) * Time.deltaTime * 10);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment