Re-enable collisions
This commit is contained in:
@@ -7,4 +7,21 @@ public partial class EnemyBullet : Projectile
|
||||
{
|
||||
TranslateObjectLocal(new Vector3(0, 0, -Speed * (float)delta));
|
||||
}
|
||||
|
||||
public new void OnProjectileHit(Node node)
|
||||
{
|
||||
SetPhysicsProcess(false);
|
||||
_hitBox.QueueFree();
|
||||
|
||||
if (node is Character character && character.HasMethod(Character.MethodName.OnHit))
|
||||
{
|
||||
GD.Print("Player hit: " + character.Name);
|
||||
character.Call(Character.MethodName.OnHit, node);
|
||||
}
|
||||
|
||||
|
||||
var sfxPlayer = GetTree().Root.GetNode<AudioStreamPlayer>("Main/SFXPlayer");
|
||||
if (!sfxPlayer.Playing)
|
||||
sfxPlayer.Play();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ _hitBox = NodePath("RigidBody3D")
|
||||
|
||||
[node name="RigidBody3D" type="RigidBody3D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 0
|
||||
collision_mask = 2
|
||||
gravity_scale = 0.0
|
||||
custom_integrator = true
|
||||
continuous_cd = true
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Godot;
|
||||
using System.Linq;
|
||||
using Godot;
|
||||
|
||||
public partial class FireAtPlayer : Timer
|
||||
{
|
||||
@@ -21,9 +21,4 @@ public partial class FireAtPlayer : Timer
|
||||
GetParent().AddChild(projectile);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDied()
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user