I have only been on Unity for 3 or 4 days, so feel free to talk to me like I had my brain removed.
-
You need to use the Translate method (Unity - Scripting API: Transform.Translate).
-
The direction of movement is determined by Vector3 (Unity - Scripting API: Vector3).
-
Vector3 has some predefined values that are quite readable. Example below.
// Both options are equal
transform.Translate((Vector3.left + Vector3.up)); // Option 1: more readable
transform.Translate(new Vector3(-1, 1, 0)); // Option 2: magic mumbo jumbo
Of course, the example is not optimal, because you need deltaTime and speed.
transform.Translate((Vector3.left + Vector3.up) * Time.deltaTime * 0.1f); // To slow down
-
Beginner Scripting: Beginner Scripting - Unity Learn
-
Intermediate Scripting: Intermediate Scripting - Unity Learn
-
Junior Programmer Pathway: Junior Programmer Pathway - Unity Learn