Hi, noob here and noob in c#. Are there examples here like phaser do Phaser 3.80 Examples. I’m a self thought programmer and know as3 and little phaser js but I found scripting in c# in unity kind of difficult. Mostly because of long words to memorize. So I’m looking for a compiled example like in Phaser wherein every time I forgot what to type, I can always look for reference. Thanks.
Google around, I just found this:
You should follow my previous practices… I’ll try my best to explain.
You don’t need to remember everything. You only need to remember certain method that you want. For instance, you want the character to move. So, what I’m you need to know is using code that can move your object. In this case Velocity use to change the the X or Y position of your object. So what is Velocity and how to use it? you ask. First you can use document provide by Unity or just google it. You will see that Velocity is the child of rigidbody2d and it’ll take X and Y value. Rigidbody2D.velocity = new Vector2 (x,y);
So what is X and Y and where to get the value?you ask. You can set those value in variable or get it from anywhere else such as keyboard or controller. And there is a method you aslo need to remember and it’s “Input.GetAxis ()” this method will return value from your Keyboard. So now you get something like this:
void FixedUpdate () {
Rigidbody2D.velocity = new vector2 (Input.GetAxis("Horizontal"),0);
}
The “Horizontal” is the name of input and you can check it in Edit > Project Settings > Input and it return value from the A, D and Left, right arrow key which is a standard movement input for a game.
I strongly recommend you watching this video. It will answer most of your question.
Thanks to both of you. I will compile everything I can find.