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 .
- Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
- rigidbody.velocity = movement * speed;
2). RigidBody Collision .
- void OnCollisionEnter(Collision collision)
- {
- // Debug-draw all contact points and normals foreach (ContactPoint contact in collision.contacts)
- {
- Debug.DrawRay(contact.point, contact.normal, Color.white);
- }
3). Gravity .
- 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 .
- void OnGUI () {
- GUIButtonCountTo (0);
- GUIButtonCountTo (5000);
- GUIButtonCountTo (20000);
- GUILayout.Label ("Current score is " + score);
- }
7). Pause and Restart the Game .
- if (!isPaused) { if (GUI.Button(Rect(10,10,50,50), "Pause")) { Time.timeScale = 0f; isPaused = true; } }
8). Destroyed on Collision .
- void OnCollisionEnter (Collision col) { if(http://col.gameObject.name == "prop_powerCube") { Destroy(col.gameObject); } }
9). Sound ON and OFF .
- if(soundToggle)
- {
- audioSource.SetActive(true);
- //audioSource.mute = true;
- //audioSource.volume = 1.0f;
- }
- else
- {
- audioSource.SetActive(false);
- //audioSource.mute = false;
- //audioSource.volume = 0.0f;
- }
10). Force .
- void FixedUpdate() { rb.AddForce(transform.forward * thrust); }
11). Increase Speed .
- curSpeed += acceleration;
- if (curSpeed > maxSpeed)
- curSpeed = maxSpeed;
Articoli simili
- How to calcuate burned calories and distance after getting step counts in Android step count sensor
- Come risolvere il messaggio di errore Android.process.acore
- Come risolvere il 'purtroppo, il processo Android.process.acore si è fermato' sul mio telefono
- Se faccio un gioco con Unity craccato, posso metterlo in Google Play? Scopriranno che ho usato Unity craccato? Come?