How do i compare velocity

Godot Version

Godot 4


Hello, I’ve got a problem where I have a rigidbody2D and i need to get velocity from it. Then after I have the velocity I need to compare it like this: “if velocity > 0: do something”.

velocity > Vector2.ZERO

I’ll try it

Also how did you get the velocity?

velocity is from CharacterBody2D

Oh you’re right I forgot to specify that it’s a enemy and it made using rigidbody2D. (I can’t find the velocity)

linear_velocity is a property of a RigidBody2D: