Moving a character using C#

Hello, and I was mindlessly following a tutorial to learn skills to make my own 2d MMORPG but the code I ran wasn’t working. He had different default code than I had when I opened visual studio code. I tried just adding curly brackets under static.void and copying his code but that didn’t work. One of my discord friends said he was using java. I already asked this question and I couldn’t find it after I postedd it and it wasn’t saved to my profile.

I actually want to know how to make my character move for mobile devices when I touch the touch screen, and mouse clicks for nox/computer android emulator.

I have never run my own actual working code. So any answer I can just copy and see my actual player move will motivate me to continue my journey…

Like I said, so the default code in the tutorial is different…

It was defined in another tutorial I watched as having something like your starting code (one string) and the code you eant run in each fram (second string) and I was missing those two seperate strings…

I’m also gonna throw my 2 cents on this:

Please start smaller. Way smaller.

Try replicating a game like flappybirds first. When you managed this, go on to tetris.

After that try to build your own small idea.

When you are done with that you will have a better understanding that a MMORPG is out of scope. This just does not happen from 1 person.

To tackle your actual issues:
Are you sure that the files that you created have the ending “.cs”?

Other then that please follow the advice that was already given by others: try a fresh and clean installation where you follow a guide somewhere. Start a fresh and clean project.

Try to just create a script in a new project that outputs “Hello World” to the console. If that works, your setup is probably ok.

This should be very basic understanding that there are different languages used in programming.

for example unity mainly uses the “C#” language to code most of its stuff.
might suggest basic understanding of coding.

as a basic explanation to your problem is that you are trying to use the same language as in the tutorial “java” while using the unity engine to code in “C#”, its like trying to explain to a Russian person how to do to do a job while you don’t know Russian and he doesn’t know English.

so in C# you’d write static.void as static void.

idk what your setup is when you installed unity and a version but you might want to watch a tutorial on that too, like “How to install Unity”.

you should watch tutorials on unity only if working with unity.

lastly here is the basic code you want for a beginner

using UnityEngine;

public class BasicMovment : MonoBehaviour
    public float moveSpeed = 100f;

    //keyboard movment input
    float xInput = 0;
    float zInput = 0;

    // Update is called once per frame
    void Update()
        if (Input.anyKey)
             xInput = Input.GetAxis("Horizontal");
             zInput = Input.GetAxis("Vertical");
             transform.position += new Vector3(xInput * Time.deltaTime * moveSpeed, 0, zInput * Time.deltaTime * moveSpeed);

I also tried with erasing the default and just copy/pasting your script…