make players collider with water bombs
This commit is contained in:
parent
a902cd56fc
commit
d80381c489
@ -18,6 +18,7 @@ _projectile_holder = NodePath("ProjectileHolder")
|
||||
_production_timer = NodePath("DropTimer")
|
||||
|
||||
[node name="MultiplayerSpawner" type="MultiplayerSpawner" parent="."]
|
||||
_spawnable_scenes = PackedStringArray("res://src/ingame/water_bomb.tscn")
|
||||
spawn_path = NodePath("../ProjectileHolder")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
|
@ -87,6 +87,7 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
_projectile_holder.add_child(new_projectile, true)
|
||||
_set_projectile_authority.rpc(new_projectile.get_path(), id)
|
||||
new_projectile.set_global_pos.rpc(_projectile_point.global_position)
|
||||
new_projectile.sender_body = self
|
||||
|
||||
new_projectile.body.process_mode = Node.PROCESS_MODE_INHERIT
|
||||
new_projectile.body.linear_velocity = -_camera.global_basis.z * _projectile_speed
|
||||
|
@ -10,6 +10,8 @@ extends Node3D
|
||||
|
||||
var _in_splash_range := {}
|
||||
|
||||
## something to ignore
|
||||
var sender_body: PhysicsBody3D
|
||||
|
||||
func _ready() -> void:
|
||||
body.process_mode = Node.PROCESS_MODE_DISABLED
|
||||
@ -30,6 +32,9 @@ func _disable_body() -> void:
|
||||
|
||||
|
||||
func _on_body_entered(p_body: Node3D) -> void:
|
||||
if p_body == sender_body:
|
||||
return
|
||||
|
||||
if p_body.is_in_group("voids"):
|
||||
queue_free()
|
||||
return
|
||||
|
@ -81,6 +81,7 @@ draw_pass_1 = SubResource("SphereMesh_bhdh4")
|
||||
[node name="RigidBody3D" type="RigidBody3D" parent="."]
|
||||
top_level = true
|
||||
collision_layer = 4
|
||||
collision_mask = 3
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 1
|
||||
linear_damp_mode = 1
|
||||
|
Loading…
Reference in New Issue
Block a user