Why does Godot say i cant use a vector2 and int with >

Godot Version

4

Question

var player_position = player.global_position
var distance_to_player = (owner as Enemy).global_position.direction_to(player_position)
if distance_to_player > DISTANCE_TO_STOP_CHASING && randf() > CHANCE_TO_STOP_CHASING:
im unsure how im suposed to change the first “>” since that what im trying to accomplish

direction_to() returns a vector. You probably want distance_to().

thanks dude I’ve spent probably 30 min looking through godot docs not realizing it was just me spelling it wrong and it auto correcting

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.