Knockback enemies in 3D

Godot Version



Hello everyone, and I am writing again with the hope that someone will answer. I want the kick to repel enemies. I have a kick that kicks objects on the player.
Here it is
if Input.is_action_pressed(“kick”):
var collider = interaction.get_collider()
if collider is RigidBody3D:
kick_object = collider
var knockback = kick_object.global_position - point.global_position
kick_object.apply_central_impulse(knockback * -5)
how to make it work on CharacterBody3D .
I tried different options but couldn’t implement them correctly and unfortunately the guides that I found were on 2D
Thanks in advance for your concern