Godot Version
v4.2.1
Question
i got in var is_casting = false setget set_is_casting():
here all the code:
extends RayCast2D
var is_casting = false setget set_is_casting():
Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
Called every frame. ‘delta’ is the elapsed time since the previous frame.
func _process(delta):
pass
func _physics_process(delta: float)-> void:
var cast_point := target_position
force_raycast_update()
if is_colliding():
cast_point = to_local(get_collision_point())
$Line2D.points[1] = cast_point
func set_is_casting(cast: bool) → void:
is_casting = cast