Muzzle Particle added(funktioniert auch)

This commit is contained in:
klikev
2024-07-02 18:23:10 +02:00
parent df37d14120
commit e85036bb28
9 changed files with 5045 additions and 67 deletions

View File

@@ -4,7 +4,7 @@ using UnityEngine;
public class WeaponScript : MonoBehaviour
{
public ParticleSystem muzzle;
public GameObject spawnpoint;
public GameObject bullet;
@@ -32,6 +32,8 @@ public class WeaponScript : MonoBehaviour
public void shoot(){
if(ammo != 0){
if(Input.GetKeyDown(KeyCode.Mouse0)){
muzzle.gameObject.SetActive(true);
//muzzle.Play();
Instantiate(bullet,spawnpoint.transform.position,transform.rotation);
ammo--;
}
@@ -43,8 +45,8 @@ public class WeaponScript : MonoBehaviour
}
void Start()
{
dataBullet = GetComponentInChildren<DataBullet>();
ammo = dataBullet.ammo;
muzzle = spawnpoint.GetComponentInChildren<ParticleSystem>();
}
// Update is called once per frame