FINISHED DAMN DROP SYSTEM
This commit is contained in:
parent
3302fcfc96
commit
100afe5e51
17 changed files with 151 additions and 25 deletions
17
scripts/multiplayer/spawn_system/dyn_objects_spawner.gd
Normal file
17
scripts/multiplayer/spawn_system/dyn_objects_spawner.gd
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
extends MultiplayerSpawner
|
||||
|
||||
func _ready() -> void:
|
||||
spawn_function = request_spawn
|
||||
Session.dynamic_objects_spawner = self
|
||||
|
||||
func request_spawn(data: Variant) -> Node:
|
||||
if data.has_all(["scene","impulse"]):
|
||||
var projectile: RigidBody3D = load(data.scene).instantiate()
|
||||
if data.has_all(["ammo","remaining_ammo","slot"]):
|
||||
projectile.weapon.ammo = data.ammo
|
||||
projectile.weapon.remaining_ammo = data.remaining_ammo
|
||||
projectile.slot = data.slot
|
||||
|
||||
projectile.apply_impulse(data.impulse)
|
||||
return projectile
|
||||
return Node.new()
|
||||
Loading…
Add table
Add a link
Reference in a new issue