Godot Version
4.5.1
Question
Hello everyone,
I’m new to game development and to Godot, and decided to make a simple fishing game to get a grasp of a few concepts of the engine. I want the player to use the arrow buttons to move a fishing hook up and down, into and outside a body of water. Made the hook a CharacterBody2D with an AnimatedSprite2D and a CollisionShape2D, but just the hook. That’s because i only want the hook to move.
Because of that, i have a static Sprite of a character holding the fishing rod with part the line hanging, and the sprite of the hook connects to the end of it. What I want to happen is that when the user moves down, the fishing line follows the edge of the hook, and when it comes up, the line disappears, “retracting” into the rod. Problem is, I just don’t understand how the Line2D works. I watched a few tutorials, and it’s probably because I’m currently sleep deprived, but I just couldn’t understand any of it.
Do you guys know how I would be able to make the line come into existance from the tip of the fishing line in the character Sprite and connect to the hook Sprite, disappearing when the hook goes up? Is Line2D the optimal way to do an animation like that?
I also thought of using a 1px by 1px (size of the line) tile that creates if the hook moves down and disappears when it moves up, but that seems impractical.
Thanks in advance!