QNA > W > What's The Step By Step Process Of Creating A Game In Unity 3D?

What's the step by step process of creating a game in Unity 3D?

You will get lots and lots of Tutorials on unity3d .

, Home , http://Unity3d.com .

But if you will learn the basic functions , Your Precious Time in unity3d Scripting will be saved a lot like :-

1). Movements like Horizontal , Vertical , Up and Down .

  1. Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical); 
  2. rigidbody.velocity = movement * speed; 

2). RigidBody Collision .

  1. void OnCollisionEnter(Collision collision)  
  2. // Debug-draw all contact points and normals foreach (ContactPoint contact in collision.contacts)  
  3. Debug.DrawRay(contact.point, contact.normal, Color.white);  

3). Gravity .

  1. Physics.gravity = new Vector3(0, -1.0F, 0); 

4). Friction .

rigidbody2D.AddForce(new Vector2(inputX * xSpeed, 0));

5). Bouncing .

Add Component -> Physics -> Rigidbody

Add Component -> Physics -> Sphere collider

Assets -> Create -> Physics material

Set Bounciness to 0.8

6). Score Increment .

  1. void OnGUI () {
  2. GUIButtonCountTo (0);
  3. GUIButtonCountTo (5000);
  4. GUIButtonCountTo (20000);
  5. GUILayout.Label ("Current score is " + score);
  6. }

7). Pause and Restart the Game .

  1. if (!isPaused) { if (GUI.Button(Rect(10,10,50,50), "Pause")) { Time.timeScale = 0f; isPaused = true; } } 

8). Destroyed on Collision .

  1. void OnCollisionEnter (Collision col) { if(http://col.gameObject.name == "prop_powerCube") { Destroy(col.gameObject); } } 

9). Sound ON and OFF .

  1. if(soundToggle)
  2. {
  3. audioSource.SetActive(true);
  4. //audioSource.mute = true;
  5. //audioSource.volume = 1.0f;
  6. }
  7. else
  8. {
  9. audioSource.SetActive(false);
  10. //audioSource.mute = false;
  11. //audioSource.volume = 0.0f;
  12. }

10). Force .

  1. void FixedUpdate() { rb.AddForce(transform.forward * thrust); } 

11). Increase Speed .

  1. curSpeed += acceleration;
  2. if (curSpeed > maxSpeed)
  3. curSpeed = maxSpeed;

Di Almond Ibarhim

Qual è la differenza principale tra lo sviluppo di giochi 2D e 3D? :: Perché le stelle ipergiganti sono così grandi?
Link utili