Advertisement
Guest User

Untitled

a guest
Feb 10th, 2021
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class SpawnBullet : MonoBehaviour
  6. {
  7.     [SerializeField]
  8.     private GameObject Bullet;
  9.     [SerializeField]
  10.     private GameObject Camera;
  11.     private void Update()
  12.     {
  13.         if (Input.GetKey(KeyCode.Q))
  14.         {
  15.             Instantiate(Bullet, Camera.transform.position, Camera.transform.rotation);
  16.         }
  17.     }
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement