My first small project; sorry about the basic question, I'll give you an overview of my setup.
I have a player (CharacterBody2D) and a ball (Area2D)
The code I have working allows my player to run around and pick up my ball. The ball sticks close to the player and then the player can move a target in a radius around them and click to fire the ball in that direction.
the main bits of relevant code below
set angle (on player) =ball.direction = (get_global_mouse_position() - self.global_position).normalized()
moving ball (ball - called every frame if ball is kicked ) = self.global_position += direction * speed * delta
With this logic the ball fires correctly but will obviously just keep going forever. What would be the correct way to set a power or distance? I want to use a power variable I have set up to change it and my initial idea was to set an 'end point' vector2 and either check it at the movement script that runs every frame but I just can't figure out generating that vector2 point or if that's even the way to go
Will attach more code and / or videos if needed