Created Teleport Boundry for it player falls out off the map they respawn
This commit is contained in:
14
Assets/components/teleport_boundry.tscn
Normal file
14
Assets/components/teleport_boundry.tscn
Normal file
@ -0,0 +1,14 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dn2rvffy4bdtr"]
|
||||
|
||||
[ext_resource type="Script" path="res://Assets/scripts/TeleportBoundry.gd" id="1_tdj4j"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_h7x6y"]
|
||||
size = Vector3(10000, 1, 10000)
|
||||
|
||||
[node name="TeleportBoundry" type="Area3D"]
|
||||
script = ExtResource("1_tdj4j")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("BoxShape3D_h7x6y")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
4
Assets/scripts/TeleportBoundry.gd
Normal file
4
Assets/scripts/TeleportBoundry.gd
Normal file
@ -0,0 +1,4 @@
|
||||
extends Area3D
|
||||
|
||||
func _on_body_entered(body):
|
||||
body.respawn()
|
||||
Reference in New Issue
Block a user