2D: Moving Up On A Diagonal Plane

Hey there,

I am quite new to programming so please bare with me. But currently I have a scene where I have angled the plane (x = -5) and a 2D character sprite, (this is going to be hard for me to phrase) but I want to make it so that when the player moves up they move up on the rotation that the plane is at rather than going horizontally/straight up.

Here are some images to help you understand.
Scene - Imgur: The magic of the Internet
Scene - Imgur: The magic of the Internet
Script - Imgur: The magic of the Internet

Any help will be of benefit, thank you!

In addition to moving in the Y axis, you would need to move along the Z axis.

What you’re doing in line 21 is equivalent to this:

transform.Translate(new Vector3(0f, 1f, 0f) * Input.GetAxisRaw("Vertical") * moveSpeed * Time.deltaTime, 0f));

So, instead of using the (0,1,0) Vector, you need to use the vector that follows the direction of your plane. Something like new Vector3(0,1,1).normalized

transform.Translate(new Vector3(0f, 1f, 1f).normalized * Input.GetAxisRaw("Vertical") * moveSpeed * Time.deltaTime, 0f))