Any way to simplify this Vector2 IF statement?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By arthurZ

What I need is to compare only Vector2(0,0) and Vector2(0,-1), nothing between the values.

What I have:

if ray_ground.get_collision_normal() != Vector2(0,-1) || ray_ground.get_collision_normal() != Vector2(0,0) || ray_ground2.get_collision_normal() != Vector2(0,-1) || ray_ground2.get_collision_normal() != Vector2(0,0) 
do something

I’m searching for something like this:

if ray_ground.get_collision_normal() != Vector2(0,[0, -1]) || ray_ground2.get_collision_normal() != Vector2(0, [0, -1])
do something

That exists?

:bust_in_silhouette: Reply From: LordViperion
max = Vector2(0,0)
min = Vector2(0,-1);
normal = ray_ground.get_collision_normal()
numx = clamp(normal.x ,min.x, max.x)
numy = clamp(normal.y ,min.y, max.y)
inRange = if ((numx == normal.x) && (numy == normal.y))