Godot Version
Godot 4.3
Question
I am having a problem with get_wall_normal()
.
What i am trying to do is when whenever a characterbody2D
collides with something (Example: a wall) it will detect the normal of the wall so I can use it to reverse the velocity in that direction.
So if the velocity
was Vector2(10 , 0)
and it collided
with a normal of Vector2(1 , 0)
, then the velocity would be set to Vector2(-10 , 0)
The problem is that when the characterbody2D
collides with an what should be an x normal (Left and right), get_wall_normal()
returns fine, but when it collides with what should be a y normal (Up and down) the function does not update and returns whatever it was before
Am I not understanding what get_wall_normal()
does or is there something wrong with my code?