# Conflicts:
#	Assets/Scenes/Story1.unity
#	Assets/Scenes/Story1.unity.rej
#	Assets/Scripts/Bullet.cs
#	Assets/Scripts/EnemyHealth.cs
#	Assets/Scripts/Shoot.cs
This commit is contained in:
2026-08-20 11:44:36 +02:00
23 changed files with 464 additions and 187 deletions
+13 -4
View File
@@ -1,35 +1,39 @@
//Oliver
using UnityEngine;
public class Bullet : MonoBehaviour
public class ARBullet : MonoBehaviour
{
public float speed;
public int damage;
public int damage = 20;
private Vector3 position = Vector3.forward;
private Rigidbody rb;
void Start()
{
GetComponent<Rigidbody>();
}
// Update is called once per frame
void Update()
{
transform.Translate(position.normalized * speed * Time.deltaTime);
}
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.tag == "Enemy")
{
<<<<<<< HEAD
<<<<<<< HEAD
Destroy(collision.gameObject);
=======
=======
>>>>>>> 392d23632b62942df19732b9e125c98967abd9e4
EnemyHealth enemy = collision.gameObject.GetComponent<EnemyHealth>();
if (enemy != null)
{
enemy.TakeDamage(damage);
<<<<<<< HEAD
Destroy(gameObject);
}
@@ -37,10 +41,15 @@ public class Bullet : MonoBehaviour
>>>>>>> parent of 392d236 (Merge branch 'main' of https://git.bib.de/PBA3H25ABU/ClearTheZone)
=======
>>>>>>> parent of 392d236 (Merge branch 'main' of https://git.bib.de/PBA3H25ABU/ClearTheZone)
=======
}
Destroy(gameObject);
>>>>>>> 392d23632b62942df19732b9e125c98967abd9e4
}
else if(collision.gameObject.tag == "Wall")
{
Destroy(this);
Destroy(gameObject);
}
}