I've created a Area2D node called "Bullet", and when i press the "Z" button, that node is called right into the Main Scene, and that was working really well.
The problem is, i want to set the Bullet position equals to my Position2D Node position (which belongs to the player node), and for some reason i don't know, that code i wrote doesn't work, what have i done wrong? Thanks is advance.
Shoot Function
if Input.is_action_just_pressed("Shoot"):
var bullet = bPath.instance()
bullet.position = $Position2D.global_position
get_tree().current_scene.add_child(bullet)
Here's the Node hierachy:
Player
|----AnimatedSprite
|----CollisionShape
|----Camera2D
|----Position2D
Bullet
|----AnimatedSprite
|----CollisionShape