the-crypt/magic/Wands/WandClass.gd

12 lines
319 B
GDScript3
Raw Normal View History

2020-07-19 18:36:36 -05:00
extends Sprite
class_name Wands
func fire(projectile, effect):
if $ShootDelay.is_stopped() and projectile != null:
print("fire")
var temp = projectile.instance()
get_tree().current_scene.add_child(temp)
temp.global_transform = $ProjectileSpawn.global_transform
temp.launch(null, null)
$ShootDelay.start()