1.导入一个枪的模型,调整好枪的位置
2.点击ScifiRifle(枪)右键创建一个Crete Empty(空的物体)命名fireponint代表子弹生成的位置
3. 制作一个简易的子弹,右键3D object→spher这里我们选用spher将其命名为bulletpoint放到合适的位置
4.编写子弹发射脚本 点击Add Component→Guncontral在Assets右键Create→C# Script
5脚本内容
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class guncontral : MonoBehaviour
{
//子弹生成位置
public Transform bulletpoint;