So hi there, hello...
I changed from Unity to Godot a few days ago and my first project is a simple 2D platformer with shooting mechanics.
I've implemented basic movement and a button to shoot bullets with. The most recent feature I've implemented is to flip the player while moving left and right by inverting the scale. Everything went well, but I noticed that, because I set the velocity value of the bullets to a Vector2(1,0), all of them are shot in the players direction if he is facing left. So I thought by changing the velocity to Vector2(-1,0), the bullets would move to the left side of the screen after being instantiated, wich is the case.
However, now I need to change the velocity value depending on the way the player faces. The problem is, the if-Statements wich determine when the player faces left or right are in my Player script, wich is attached to the player node in my scene. The velocity value of the bullets is in the bullets script, wich is attached to the bullet "Prefab"(scene or whatever).
So I did some research and as it turns out: I need to make use of something called signals. But no matter what tutorial I watch or documentation I read, they always use the Editor feature to connect the signal to the receiver node. My problem is that the bullets are to be instantiated while playing the game, not at the beginning of it. So I somehow need to make the connection of the signal to a script rather than to a node...I think...
Does anyone with more expirience than me know what to do here?