Shoot bullet in unity easy tutorial | Tap input | Destroy bullets

Subscribers:
1,020
Published on ● Video Link: https://www.youtube.com/watch?v=P3OVgw2KToc



Game:
Category:
Tutorial
Duration: 3:29
57 views
6


Tap Input = 1:23
Destroy bullets= 2:55

Code :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Shoot : MonoBehaviour
{
public Transform spawnpoint;
public GameObject bullet;
public float speed;

// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
if (Input.GetButtonDown("Fire1"))
{
var newBullet = Instantiate(bullet,spawnpoint.position,spawnpoint.rotation);
newBullet.GetComponent less than sign Rigidbody greater than sign ().AddForce(transform.forward*speed);
Destroy(newBullet,2f);
}
}
}







Tags:
unity
unity3d
unity2d
learn unity
unity tutorials
shoot bullet in unity
shootanything in unity



Other Statistics

Shoot the Bullet Statistics For Muhammad Shahzaib

At present, Muhammad Shahzaib has 57 views spread across 1 video for Shoot the Bullet, and less than an hour worth of Shoot the Bullet videos were uploaded to his channel. This is less than 0.65% of the total video content that Muhammad Shahzaib has uploaded to YouTube.