Created Spawn Point that sets global spawn point and respawns player
This commit is contained in:
7
Assets/components/spawn_point.tscn
Normal file
7
Assets/components/spawn_point.tscn
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[gd_scene load_steps=2 format=3 uid="uid://cpwg1ula5qbrl"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://Assets/scripts/SpawnPoint.gd" id="1_1dk7k"]
|
||||||
|
|
||||||
|
[node name="SpawnPoint" type="Node3D"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.72563, 0.394659, -9.82302)
|
||||||
|
script = ExtResource("1_1dk7k")
|
||||||
7
Assets/scripts/SpawnPoint.gd
Normal file
7
Assets/scripts/SpawnPoint.gd
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
extends Node3D
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready():
|
||||||
|
GlobalSettings.SetSpawnPoint(self.global_position)
|
||||||
|
get_tree().call_group("Player", "respawn")
|
||||||
Reference in New Issue
Block a user