using apply_force or alternative

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By devcutter

so i want to make a 2d space game where the player have different spaceships so its important to use the mass system hence why im trying to use apply_force() maybe i got it wrong but for some reason all i can do is apply my force to a global axis so its always moving in the same direction.
so my question is how would i add force to my player ship to be relative to the orientation?
i tried alot of things as of late this is how it looks like the rotation works fine but my rotation variable always return 0 for some reasons i feel im missing a small details ive read and reread the documentation but couldnt find it

extends Node2D
var thrust_power = 10
var reverse_thrust_power
var move_speed = Vector2(thrust_power , 0)
var rotation_speed = 1
@onready var player_rigidbody := $RigidBody2D
# Called when the node enters the scene tree for the first time.
func _ready():
	thrust_power = thrust_power * 50
	reverse_thrust_power = thrust_power / 3
	rotation_speed = rotation_speed * 50


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _physics_process(delta):
	if Input.is_action_pressed("Move up"):
		move_speed = Vector2(thrust_power, 0).rotated(rotation)
	elif Input.is_action_pressed("Move Down"):
		player_rigidbody.apply_central_force(move_speed * delta)
	if Input.is_action_pressed("Move Right"):
		player_rigidbody.apply_torque(rotation_speed * delta)
	if Input.is_action_pressed("Move Left"):
		player_rigidbody.apply_torque(-rotation_speed * delta)

*edit i finally found it

if Input.is_action_pressed("Move up"):
	move_speed = Vector2(-thrust_power, 0).rotated(player_rigidbody.rotation)

i was trying to access the rotation of my parent node and not directy the rotation of rigidbody i think