Godot Version
v4.3.stable.steam [77dcf97d8]
Question
extends RigidBody2D
func _on_body_entered(body: Node) -> void:
if PhysicsServer3D.body_get_param(self.get_rid(), PhysicsServer3D.BODY_PARAM_GRAVITY_SCALE) == 1:
PhysicsServer3D.body_set_param(self.get_rid(), PhysicsServer3D.BODY_PARAM_GRAVITY_SCALE, -1)
else:
PhysicsServer3D.body_set_param(self.get_rid(), PhysicsServer3D.BODY_PARAM_GRAVITY_SCALE, 1)
how do I flip the gravity upon collision with another node