Deactivate / activate the world on teleporting to a dungeon.

This commit is contained in:
Relintai 2021-08-28 00:09:05 +02:00
parent 5dc0ed2daf
commit c6ae7518c0
3 changed files with 7 additions and 1 deletions

View File

@ -56,6 +56,7 @@ func teleport():
_dungeon.hide() _dungeon.hide()
#turn back on world #turn back on world
world.active = true
p.get_body().teleport(teleport_to) p.get_body().teleport(teleport_to)
# p.get_body().transform.origin = teleport_to # p.get_body().transform.origin = teleport_to

View File

@ -78,6 +78,7 @@ func teleport():
get_parent().add_child(_dungeon_back_teleporter) get_parent().add_child(_dungeon_back_teleporter)
#turn off world #turn off world
world.active = false
#turn on dungeon #turn on dungeon
_dungeon.show() _dungeon.show()

View File

@ -91,6 +91,9 @@ func generate():
func _process(delta): func _process(delta):
if !active:
return
if initial_generation: if initial_generation:
return return
@ -290,7 +293,8 @@ func spawn(start_x : int, start_z : int) -> void:
if l > chunk_spawn_range: if l > chunk_spawn_range:
continue continue
chunk_create(x, z) if !chunk_get(x, z):
chunk_create(x, z)
# add_prop(Transform().translated(Vector3(0, 2, 0)), test_prop) # add_prop(Transform().translated(Vector3(0, 2, 0)), test_prop)