Im trying to make a top down shooter and when I shoot it blows up and displays this:
extends Node2D
var bullet = load(“res://bullet.tscn”).instance()
Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
Called every frame. ‘delta’ is the elapsed time since the previous frame.
func _process(delta):
look_at(get_global_mouse_position())
if Input.is_action_just_pressed(“click”):
var billet = bullet.instance()
bullet.position = position
get_parent().add_child(billet)
This is the bullet script:
extends Area2D
var speed = 600
Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
Called every frame. ‘delta’ is the elapsed time since the previous frame.
func _physics_process(delta):
position.y -= speed * delta
I am using godot 3