Add rigidbody2d.velocity according to axis arrows

Hello I want to make it so when i use rigidbody2d.velocity and for example add 5 velocity on the x axis , it naturally adds 5 velocity on the x axis , simple . But what i want to do is i want to rotate the character with the E and Q buttons (Which ive already done) and when i press W to add velocity to my player , I want it to not add velocity towards the X axis but to the front of the player , how can I manage to do this

Rotation Script :

float rotationInput = Input.GetAxis("Rotation");

float rotationForce = rotationInput * Time.deltaTime * rotationPower

transform.Rotate(new Vector3(0, 0, rotationForce));

Movement Script:

moveInput.x = Input.GetAxisRaw("Horizontal");
moveInput.y = Input.GetAxisRaw("Vertical");
moveInput.Normalize();

rb.velocity = transform.up * moveInput.y * Time.deltaTime * moveSpeed * multiplier;

Extra detail if you couldnt understand :

So im gonna press W to go front , which works at 0 degrees angle because im my upper part is pointed towards the y axis so it adds 5 velocity to the y angle

But when i rotate it to 45 degrees angle , it doesnt go forward of the player blue arrow but goes towards the y axis black arrow


Thanks!

I used this and it works . Here is the code if you wonder :

float rotationInput = Input.GetAxis("Rotation");

float rotationForce = rotationInput * Time.fixedDeltaTime * rotationPower;

rb.MoveRotation(rb.rotation + rotationForce);

Update : Changed the movement script .

Replaced

rb.velocity = transform.up * moveInput.y * Time.deltaTime * moveSpeed * multiplier;

With

rb.velocity = transform.up * moveInput.y * Time.deltaTime * moveSpeed * multiplier + transform.right * moveInput.x * Time.deltaTime * moveSpeed * multiplier;

No idea why you’re scaling an absolute velocity by the elapsed frame-time as that makes no sense. Velocity is integrated during the simulation step (to give a new position) by the elapsed time. It might make sense if you were calculating acceleration etc but you’re not.