Difference between revisions of "ReactToAccelerometer"

From Headbone Creative
Jump to: navigation, search
(Initial page, includes API information and categories)
 
(Updating API info)
 
Line 1: Line 1:
This script controls the position of the object it is attached to, relative to its starting position. It has options for reacting to motion in 2 or 3 dimensions.  
+
This script controls the position of the object it is attached to using the device's [http://docs.unity3d.com/Documentation/ScriptReference/Input-acceleration.html acceleration], relative to its starting position. It is completely configurable how the input from the accelerometer is mapped on to the position of the object.  
  
  
 
== Public Variables ==
 
== Public Variables ==
=== movementModifier : float ===
+
=== xInputMapping : InputAxis ===
The movement modifier. This is a multiplier applied to the [http://docs.unity3d.com/Documentation/ScriptReference/Input-acceleration.html acceleration] when calculating the new position of the object.
+
This tells the script how to map the input from the accelerator onto the x axis.
=== movementSpeed : float ===
+
=== xInputModifier : float ===
 +
This multiplier is applied to the input on the x axis.
 +
=== yInputMapping : InputAxis ===
 +
This tells the script how to map the input from the accelerator onto the y axis.
 +
=== xInputModifier : float ===
 +
This multiplier is applied to the input on the y axis.
 +
=== zInputMapping : InputAxis ===
 +
This tells the script how to map the input from the accelerator onto the z axis.
 +
=== zInputModifier : float ===
 +
This multiplier is applied to the input on the z axis.
 +
=== lerpSpeed : float ===
 
This is how fast the object will move in the scene.  
 
This is how fast the object will move in the scene.  
=== is2dScene : bool ===
 
This determines how the movement of the device is mapped onto the movement of the object.
 
 
When true, the X and Y positions of the object updating using the Y and X inputs of the accelerometer, respectively.
 
 
When false, the X, Y and Z movement of the device is translated onto the X, Y and Z position of the object.
 
  
  

Latest revision as of 04:25, 18 April 2013

This script controls the position of the object it is attached to using the device's acceleration, relative to its starting position. It is completely configurable how the input from the accelerometer is mapped on to the position of the object.


Contents

[edit] Public Variables

[edit] xInputMapping : InputAxis

This tells the script how to map the input from the accelerator onto the x axis.

[edit] xInputModifier : float

This multiplier is applied to the input on the x axis.

[edit] yInputMapping : InputAxis

This tells the script how to map the input from the accelerator onto the y axis.

[edit] xInputModifier : float

This multiplier is applied to the input on the y axis.

[edit] zInputMapping : InputAxis

This tells the script how to map the input from the accelerator onto the z axis.

[edit] zInputModifier : float

This multiplier is applied to the input on the z axis.

[edit] lerpSpeed : float

This is how fast the object will move in the scene.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox