Rigidbody 2D movement?

4.3

I’m trying to make a controllable rigidbody, but this code isn’t working. Any ideas on what’s wrong?

extends Node2D

var power = 100

func _physics_process(delta):
var axis = Input.get_action_strength(“Right”) -Input.get_action_strength(“Left”)

$Body.apply_impulse(Vector2.ZERO, Vector2.RIGHT * axis * power)

Never mind, I received help from someone who reworked the code to this:

$Body.apply_central_impulse(Vector2.RIGHT * axis * power)