Godot 4.2.1
I am new in Godot and I have small project, and I want to create small bubble shooter game and I did not know how can I draw prediction line like in image below in Godot 4.2.1, my scene tree is like that, RigidBody2D(Root) and Sprite2D, CollisionShape2D is child it, and my script code like that for shoot the ball: `
extends RigidBody2D
var launcher_position
var shooting = false
func _process(delta):
if (Input.is_action_just_pressed("click")):
launcher_position = get_global_mouse_position()
shooting = true
if shooting:
var current_position = get_global_mouse_position()
var dir = (current_position - launcher_position).normalized()
linear_velocity = dir * delta * 20000
if (Input.is_action_just_released("click")):
shooting = false
`
and image :
and I want to adding prediction line like image, any idea will appreciated.
