- Edited
Hey yall, new to godot learning and i've been having fun with the engine! however i'm kind of stuck on this exact script's lines, as they all make sense yet they still come with an error!
the code so far for the script is:
extends Area2D
var speed = 200
var vel : Vector2
const exploding = preload("res://Explosion.tscn")
func _ready():
vel = Vector2(speed, 0).rotated(Global.player.degForBullet)
pass
func _process(delta):
position += vel * delta
func _on_bullet_body_entered(body):
exploding.instance()
exploding.global_position = global_position
add_child(exploding)
any help really appreciated!