using System.Collections; using System.Collections.Generic; using UnityEngine; public class Makarov : MonoBehaviour { public GameObject Bullet; public float BulletSpeed; public Transform ShootPoint; // Update is called once per frame void Update() { if(Input.GetMouseButtonDown(0)) { shoot(); } } void shoot() { GameObject BulletIns = Instantiate(Bullet, ShootPoint.position, ShootPoint.rotation); BulletIns.GetComponent<Rigidbody2D>().AddForce(BulletIns.transform.forward * BulletSpeed); } }
When I shoot the bullets just stop right in front if the gun. This is for a top down shooting.