Make it possible to dynamically set weapon parans

This commit is contained in:
2025-01-28 10:51:45 +01:00
parent 06a1d28e42
commit b54ffaeb0d
11 changed files with 106 additions and 83 deletions

View File

@ -26,12 +26,15 @@ func _ready() -> void:
$MultiplayerSpawner.spawn(char)
players.add_child(char)
var bullet_amount: int = 0
func spawn_bullet(position):
func spawn_bullet(starting_point: Node3D, speed: int, damage: int):
var node: Node3D = ResourceLoader.load("res://scenes/weapon/bullet.tscn").instantiate()
node.position = position.global_position
node.transform.basis = position.global_transform.basis
node.position = starting_point.global_position
node.transform.basis = starting_point.global_transform.basis
node.name = str(bullet_amount)
node.speed = speed
node.damage = damage
bullet_amount += 1
#$BulletSpawner.spawn(node)
$Bullets.add_child(node)