make bullets go dissapear when hit something
This commit is contained in:
parent
5f408e896c
commit
66dec3d98c
@ -15,5 +15,14 @@ namespace Saltosion.OneWeapon.Bullets {
|
||||
Body.velocity = Direction * 15;
|
||||
Body.rotation = Rot - 90;
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D collider) {
|
||||
if (collider.GetComponent<Player>() != null) {
|
||||
// don't hit the player!
|
||||
return;
|
||||
}
|
||||
Destroy(gameObject);
|
||||
Debug.Log("Boom!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,14 +10,6 @@ namespace Saltosion.OneWeapon {
|
||||
|
||||
private bool IsHeld = false;
|
||||
|
||||
void Start() {
|
||||
|
||||
}
|
||||
|
||||
void Update() {
|
||||
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D collider) {
|
||||
if (IsHeld) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user