i made a simple character movement script and i have a rigidbody2d in the scene that i want to push around. everything works fine until i try to push it from above. then it acts like the object is weightless. why does this happen and how do i fix it?
var col = get_slide_collision(i)
if col.get_collider() is RigidBody2D:
var push_force = ((PUSH_FORCE * velocity.length() / max_speed) + min_push_force) * scale.x * scale.x / 2 #the bigger the player the easier they push
col.get_collider().apply_central_impulse(-col.get_normal() * push_force)```
var PUSH_FORCE = 10.0
var min_push_force = 5.0
var max_speed = 100.0
func _physics_process(delta):
for i in range(get_slide_count()):
var col = get_slide_collision(i)
if col.get_collider() is RigidBody2D:
var push_force = ((PUSH_FORCE * velocity.length() / max_speed) + min_push_force) * scale.x * scale.x / 2
var direction = -velocity.normalized() # Direction of force opposite to movement
col.get_collider().apply_central_impulse(direction * push_force)