Tutorial by Examples

Input must must read from the Update function. Reference for all the available Keycode enum. 1. Reading key press with Input.GetKey: Input.GetKey will repeatedly return true while the user holds down the specified key. This can be used to repeatedly fire a weapon while holding the specified key ...
Input.acceleration is used to read the accelerometer sensor. It returns Vector3 as a result which contains x,y and z axis values in 3D space. void Update() { Vector3 acclerometerValue = rawAccelValue(); Debug.Log("X: " + acclerometerValue.x + " Y: " + acclerometerV...
Using raw values directly from the accelerometer sensor to move or rotate a GameObject can cause problems such as jerky movements or vibrations. It is recommended to smooth out the values before using them. In fact, values from the accelerometer sensor should always be smoothed out before use. This ...
Read the accelerometer Sensor with precision. This example allocates memory: void Update() { //Get Precise Accelerometer values Vector3 accelValue = preciseAccelValue(); Debug.Log("PRECISE X: " + accelValue.x + " Y: " + accelValue.y + " Z: " + acc...
These functions are used to check Mouse Button Clicks. Input.GetMouseButton(int button); Input.GetMouseButtonDown(int button); Input.GetMouseButtonUp(int button); They all take the-same parameter. 0 = Left Mouse Click. 1 = Right Mouse Click. 2 = Middle Mouse Click. GetMouseButton i...

Page 1 of 1