Added a Hazard node and used it as a killfloor in DM1

feature-rocketlauncher
unfa 2021-12-28 01:35:36 +01:00
parent d4a56e94d9
commit b5acb1dbc3
3 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,20 @@
extends Area3D
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_Hazard_body_entered(body):
#body.rpc(&'take_damage', -1, body.global_transform.origin, Vector3.ZERO, 1000, body.global_transform.origin, 0, 0 )
body.rpc(&'die', body.get_multiplayer_authority())

View File

@ -0,0 +1,16 @@
[gd_scene load_steps=3 format=3 uid="uid://bbob7ksc8vhq7"]
[ext_resource type="Script" path="res://Assets/MapComponents/Hazard.gd" id="1_i63m1"]
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_xm32e"]
[node name="Hazard" type="Area3D"]
collision_layer = 0
collision_mask = 8
monitorable = false
script = ExtResource( "1_i63m1" )
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource( "WorldBoundaryShape3D_xm32e" )
[connection signal="body_entered" from="." to="." method="_on_Hazard_body_entered"]

View File

@ -1,7 +1,8 @@
[gd_scene load_steps=8 format=3 uid="uid://cbh6i7mi0aqjs"]
[gd_scene load_steps=9 format=3 uid="uid://cbh6i7mi0aqjs"]
[ext_resource type="PackedScene" uid="uid://n3ktc2gomi2p" path="res://Assets/MapComponents/SpawnPoint.tscn" id="1"]
[ext_resource type="Material" uid="uid://cx53mnq3gateb" path="res://Assets/Materials/Maps/Dev/Dev_LightGray.tres" id="1_ndro8"]
[ext_resource type="PackedScene" uid="uid://bbob7ksc8vhq7" path="res://Assets/MapComponents/Hazard.tscn" id="2_oyi5t"]
[sub_resource type="CameraEffects" id="CameraEffects_i6883"]
dof_blur_far_enabled = true
@ -119,6 +120,9 @@ __meta__ = {
"_edit_lock_": true
}
[node name="KillFloor" parent="SpecialCollision" instance=ExtResource( "2_oyi5t" )]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -64, 0)
[node name="Decals" type="Node3D" parent="."]
__meta__ = {
"_edit_lock_": true
@ -191,3 +195,5 @@ __meta__ = {
}
[node name="SpawnPoint1" parent="SpawnPoints" instance=ExtResource( "1" )]
[editable path="SpecialCollision/KillFloor"]