Game Pitch Proposal

One for End Ethan Nasrullah, Ari, Kenneth https://docs.google.com/presentation/d/1SFCRnZXAgvTGmoLMuZQYhQ37h6-qf8RnA_-hT07o5Gs/edit?usp=sharing A game on which your goal is to kill everyone in the world. This game takes places in a normal world where, in the course of events we must kill all people with a max of 5-players to help. This game will be a story-action game, an…

Read more Game Pitch Proposal

GetComponent

UsingOtherComponents using UnityEngine; using System.Collections; public class UsingOtherComponents : MonoBehaviour { public GameObject otherGameObject; private AnotherScript anotherScript; private YetAnotherScript yetAnotherScript; private BoxCollider boxCol; void Awake () { anotherScript = GetComponent<AnotherScript>(); yetAnotherScript = otherGameObject.GetComponent<YetAnotherScript>(); boxCol = otherGameObject.GetComponent<BoxCollider>(); } void Start () { boxCol.size = new Vector3(3,3,3); Debug.Log(“The player’s score is ” + anotherScript.playerScore); Debug.Log(“The player has…

Read more GetComponent

OnMouseDown

MouseClick using UnityEngine; using System.Collections; public class MouseClick : MonoBehaviour { void OnMouseDown () { rigidbody.AddForce(-transform.forward * 500f); rigidbody.useGravity = true; } } What I Learned In this following project, I learned how to use Mouse inputs to modify and declare certain task while using the Mouse Input.  

Get Axis

AxisExamples using UnityEngine; using System.Collections; public class AxisExample : MonoBehaviour { public float range; public GUIText textOutput; void Update () { float h = Input.GetAxis(“Horizontal”); float xPos = h * range; transform.position = new Vector3(xPos, 2f, 0); textOutput.text = “Value Returned: “+h.ToString(“F2”); } } AxisRawExample using UnityEngine; using System.Collections; public class AxisRawExample : MonoBehaviour {…

Read more Get Axis

GetButton and GetKey

KeyInput using UnityEngine; using System.Collections; public class KeyInput : MonoBehaviour { public GUITexture graphic; public Texture2D standard; public Texture2D downgfx; public Texture2D upgfx; public Texture2D heldgfx; void Start() { graphic.texture = standard; } void Update () { bool down = Input.GetKeyDown(KeyCode.Space); bool held = Input.GetKey(KeyCode.Space); bool up = Input.GetKeyUp(KeyCode.Space); if(down) { graphic.texture = downgfx; }…

Read more GetButton and GetKey

Look At

CameraLookAt using UnityEngine; using System.Collections; public class CameraLookAt : MonoBehaviour { public Transform target; void Update () { transform.LookAt(target); } } What I Learned In this task, I learned about how the Unity Camera can be controlled by a script.    

Translate and Rotate

  TransformFunctions using UnityEngine; using System.Collections; public class TransformFunctions : MonoBehaviour { public float moveSpeed = 10f; public float turnSpeed = 50f; void Update () { if(Input.GetKey(KeyCode.UpArrow)) transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime); if(Input.GetKey(KeyCode.DownArrow)) transform.Translate(-Vector3.forward * moveSpeed * Time.deltaTime); if(Input.GetKey(KeyCode.LeftArrow)) transform.Rotate(Vector3.up, -turnSpeed * Time.deltaTime); if(Input.GetKey(KeyCode.RightArrow)) transform.Rotate(Vector3.up, turnSpeed * Time.deltaTime); } } What I Learned In this…

Read more Translate and Rotate

Enabling and Disabling Components

EnableComponents using UnityEngine; using System.Collections; public class EnableComponents : MonoBehaviour { private Light myLight; void Start () { myLight = GetComponent<Light>(); } void Update () { if(Input.GetKeyUp(KeyCode.Space)) { myLight.enabled = !myLight.enabled; } } } What I Learned In this task I learned how to enable and disable unity components via script and or Unity Editor.