How to move on local axis?

For this very simple script I just want the rocket to move on it’s own x axis, and not on the globals x axis

public void Update()

public void MovePlayer()
vertical = Input.GetAxisRaw(“Vertical”);
horizontal = Input.GetAxisRaw(“Horizontal”);

    rb.velocity = new Vector2(horizontal, vertical).normalized * speed;

here an Image for visualization:

Ok found the solution :slight_smile: in the MovePlayer function I added transform.TransformDirection like this:

rb.velocity = transform.TransformDirection(new Vector2(horizontal, vertical).normalized * speed);