Recerca-Cerdanya-Talk/Assets/Scripts/Level 2/Bullet2.cs
2023-08-20 17:27:37 +02:00

13 lines
333 B
C#

using UnityEngine;
namespace Level2 {
public class Bullet2 : BulletStats {
public void AddForce(int direction) {
GetComponent<Rigidbody2D>().velocity = Vector2.right * direction * bulletSpeed;
}
void OnCollisionEnter2D(Collision2D other) {
Destroy(gameObject);
}
}
}