visibility rework
This commit is contained in:
parent
6b939d241c
commit
9d0e09220d
37 changed files with 212 additions and 75 deletions
5
scripts/multiplayer/dynamic_objects_container.gd
Normal file
5
scripts/multiplayer/dynamic_objects_container.gd
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
extends Node3D
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
Session.dynamic_objects_container = self
|
||||
1
scripts/multiplayer/dynamic_objects_container.gd.uid
Normal file
1
scripts/multiplayer/dynamic_objects_container.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://be7l33prlm8gh
|
||||
|
|
@ -5,3 +5,5 @@ enum TEAMS {
|
|||
ATTACK,
|
||||
SPECTATE
|
||||
}
|
||||
|
||||
var dynamic_objects_container: Node3D
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ func spawn_spectator(id: int) -> void:
|
|||
deferred_setup.bind(inst,Session.TEAMS.SPECTATE).call_deferred()
|
||||
|
||||
func deferred_setup(what: Node3D, new_team: Session.TEAMS):
|
||||
get_tree().current_scene.add_child(what)
|
||||
get_parent().add_child(what)
|
||||
var distance = randf_range(0,spawn_radius)
|
||||
var angle = randf_range(0,TAU)
|
||||
var new_position = global_position + Vector3.RIGHT.rotated(Vector3.UP,angle) * distance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue