Is one_way_collision_direction upside down ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Matt_UV
:warning: Old Version Published before Godot 3 was released.

Hello,
I am trying to figure out how the one_way_collision_direction parameter of a PhysicsBody2D object works.

In the documentation, it is written :
void set_one_way_collision_direction( Vector2 dir )

Set a direction in which bodies can go through this one. If this value is different from (0,0), any movement within 90 degrees of this vector is considered a valid movement. Set this direction to (0,0) to disable one-way collisions.

However, in the Kinematic Character exemple, the platform vector is (0,1), and the player can go up through the object.
I seems that it works the opposite way to the documentation, or I am missing something?

By the way, as it is a direction vector, is it the same to set it as (0,1) or (0,2) ?

Thank you

Better set direction vectors to normalized values, just in case…

Bojidar Marinov | 2016-04-01 13:10

That’s what I would do indeed :slight_smile:

Matt_UV | 2016-04-01 13:56