C#: Why the rotation and moving of spaceship are conflict when I was using C#

Godot Version

4.2.2

Question

Recently I was learning how to programming Godot 3D game in C#.
I plan to let the player’s spaceship (rigid body 3D) move forward and tilt a little bit when it turn left or right. However, it looks conflict, when I using the function rotate the z axis according to the Input.x, but the spaceship can not move. On the contrary condition, it can not rotate.
Thank you very much for your help

Blockquote
public partial class SpaceShip : RigidBody3D
{
private float speedX = 50.0f;
public Godot.Vector3 directionX = Godot.Vector3.Zero;

public override void _Ready()
{
}


// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
	float input_x = Input.GetActionStrength("ui_right") - Input.GetActionStrength("ui_left");
	float input_z = Input.GetActionStrength("ui_down") - Input.GetActionStrength("ui_up");
	directionX = new Godot.Vector3(input_x, 0f, input_z);
	directionX = directionX.Normalized();
	
	float targetTilt = input_x * 10f;
	float currentTilt = RotationDegrees.Z;
	float tiltSpeed = 5f;
	float newTilt = Mathf.Lerp(currentTilt, targetTilt, tiltSpeed * (float)delta);

	GD.Print(directionX);

	ApplyMovement(directionX);
	RollFlyDegree(newTilt);
}


private void RollFlyDegree(float side)
{
Vector3 RotationDegreesTemp = RotationDegrees;
RotationDegreesTemp.Z = side;
RotationDegrees = RotationDegreesTemp;
}

private void ApplyMovement(Godot.Vector3 dir){
	Godot.Vector3 force = dir * speedX;
	float deltaTime = (float)GetProcessDeltaTime();
	GD.Print(force);
	ApplyImpulse(force * deltaTime);
}

}

Blockquote