if global_position.distance_to(grapple_collision_point) > 8:
global_position = global_position.move_toward(grapple_collision_point, grapple_speed)
else:
state = IN_AIR
This is the code for my function. grapple_collision_point
is the colliding point of a raycast2d node with the world. This code works as intended for the most part, but when the raycast2d collides with a platform with one-way collisions, it continues moving global_position
to about halfway through the platform instead of to the edge of the collision box (this happens from either direction - whether the player would normally collide with that side or not). This same platform works fine if I turn off one-way collisions.
Is this a bug with how one-way collisions are detected or is my code at fault?