Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Well, that's how I learnt how to use Unity. Was through the tutorials on that site. Those are designed for people who have never played around with whatever the tutorial is for, and then through them you slowly start to learn what you have to do.
Just underneath the video title when you go to the page for it, it'll tell you what level of difficulty the tutorial is:
"how typing anything into it, would bring any result."
Now you're getting to the coding, and probably the hardest, part. Just randomly typing things isn't gonna work. You gotta pick a language to code something in, then use it in that specific editor.
This is the code from this tutorial: https://unity3d.com/learn/tutorials/topics/2d-game-creation/bird-script?playlist=17093
Code:using UnityEngine; using System.Collections; public class Bird : MonoBehaviour { public float upForce; //Upward force of the "flap". private bool isDead = false; //Has the player collided with a wall? private Animator anim; //Reference to the Animator component. private Rigidbody2D rb2d; //Holds a reference to the Rigidbody2D component of the bird. void Start() { //Get reference to the Animator component attached to this GameObject. anim = GetComponent<Animator> (); //Get and store a reference to the Rigidbody2D attached to this GameObject. rb2d = GetComponent<Rigidbody2D>(); } void Update() { //Don't allow control if the bird has died. if (isDead == false) { //Look for input to trigger a "flap". if (Input.GetMouseButtonDown(0)) { //...tell the animator about it and then... anim.SetTrigger("Flap"); //...zero out the birds current y velocity before... rb2d.velocity = Vector2.zero; // new Vector2(rb2d.velocity.x, 0); //..giving the bird some upward force. rb2d.AddForce(new Vector2(0, upForce)); } } } void OnCollisionEnter2D(Collision2D other) { // Zero out the bird's velocity rb2d.velocity = Vector2.zero; // If the bird collides with something set it to dead... isDead = true; //...tell the Animator about it... anim.SetTrigger ("Die"); //...and tell the game control about it. GameControl.instance.BirdDied (); } }
What I like about the Unity tutorials is that it explains each line of code using comments. (The lines starting with //). Of course, for this bit though if you want to do it, you could learn C# separately. Of course, this script on it's own wont work as it's depending on different things. Best way to learn C# for this imo though is to just go through the tutorials and code while learning. It'll be quicker and easier then going through learning C# separately (and more fun).