ape-ame/Gun.gd
2024-04-23 14:38:44 -04:00

10 lines
254 B
GDScript

extends Marker2D
@export var bullet: PackedScene
func shoot():
#print("Shooting")
var node = bullet.instantiate()
node.global_position = global_position
node.linear_velocity = Vector2(500, 0).rotated(global_rotation)
$/root/Node2D.add_child(node)