Why wont he just follow the player its been 2 hrs of work and still cant get it

Godot Version

latest 4.2.1


extends CharacterBody2D
@export var speed = 100
var player_position
var target_position
@onready var player = get_parent().get_node(“CharacterBody2D”)
func _physics_process(delta):
player_position = player.position
target_position = (player_position - position).normalized()
if position.distance_to(player_position) > 3:
velocity = Vector2(target_position * speed)

  • heres the video edit:never mind im too "new"2nd edit:godot

What does your scene tree look like?

k i fixed the links @Monday

I see you changed the code, does lerp() work?
I tested the original, it works for me, that’s why I thought the issue might be in the scene tree or something, but idk :\

thanks ill try it on a new project we shall see then