Commit d57b5c78 authored by Swado95's avatar Swado95

Wrote shootStuff Shoots stuff

parent 34a8216b
using UnityEngine;
using System.Collections;
public class ShootSuff : MonoBehaviour {
public void Shoot(GameObject bul, Vector2 dir, float force = 1)
{
GameObject go = Instantiate(bul, transform.position, transform.rotation) as GameObject;
Rigidbody2D rb2d = go.GetComponent<Rigidbody2D>();
rb2d.AddForce(dir * force);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment