player.energy_points -= energy_toll
var new_bullet: Projectile = bullet.instantiate()
- new_bullet.last_movement_direction = player.last_movement_vector
new_bullet.weapon = player.model.weapon_l
+ get_tree().root.add_child(new_bullet, true)
+
new_bullet.collision_layer = player.collision_layer
new_bullet.collision_mask = player.collision_mask
-
- # TODO: global_position isn't set right until instance has been added to the scene tree
new_bullet.global_position = player.model.weapon_l.model.get_bullet_origin()
-
- get_tree().root.add_child(new_bullet, true)
+ new_bullet.direction = player.last_movement_vector