Just started using Godot engine yesterday and I'm liking the way it works. I'm trying to make a 2D Megaman-esque game with all the platforming & shooting. After using some tutorials, I found a way to spawn a scene (in this case, an image of an animated water bolt with collision) at the origin using this code:
const WATER_BOLT = preload("WaterBolt.tscn")
var waterbolt = WATER_BOLT.instance()
After using this code and finding it works, I added the next line, to spawn it at the Position2D node I had set up in the player scene:
waterbolt.position = $Position2D.global_position
This is where things broke. The game would freeze up, and the output would give me the error:
Invalid set index 'position' (on base: 'Node') with value of type
I've searched up a couple of tutorials on projectile spawned, and did some error searching, to no avail.
This is the original tutorial, linked to where the guy adds the lines of code similar to what I did: https://youtu.be/wRcGbQBq28c?t=663
I don't know what to do here, the tutorial seems recent enough, and I don't see any specific typos that would cause the error. Please try to help me with my issue.