Hello, Im new with Godot, and I`m having a problem with the Gdscript.
The problem is that Im trying to do a gun that shoots a bullet, and it aparently works except that when I instance the gun on my world scene it doesnt work as intended, and the bullet spawn in a different place inside the world(other than in the Position2D node that I made as spawn point for the bullet)
The gun works as intended in its own scene but when I instance the gun scene in the world scene it has the problems that I just said.
Im using Godot Engine 2.1.4.
Here is the code for the gun:
func spawn_bullet():
var bullet= bullet_scene.instance()
var pos= get_node("Pos_bullet").get_global_pos()
bullet.set_pos(pos)
get_parent().add_child(bullet)
Thanks in anticipation, Im having so much trouble with this.