- Home /
Question by
AmitPrasad · Jul 15, 2014 at 02:12 PM ·
rotationacceleration
Rotation Using Accelerometer
I am trying to rotate floor using Input.acceleration. I want to rotate floor around the point where player is standing. I have used the following code(C#)
Vector3 accelerometerValues = Input.acceleration;
transform.RotateAround (target.position,Vector3.back, acceleroValueX * speed * Time.deltaTime);
transform.RotateAround (target.position,Vector3.right, acceleroValueY * speed * Time.deltaTime);
But floor is gradually moving down and floor is also getting rotated around Y axis.
Comment
transform.RotateAround() will modify both position and rotation..
See here for reference, http://docs.unity3d.com/ScriptReference/Transform.RotateAround.html
Your answer

Follow this Question
Related Questions
Accelerator.x rotating camera.z - problems with intermediate values 0 Answers
Input.acceleration Y and Z are the same? 1 Answer
Rigidbody Turning 2 Answers
How rotate the cam by acceleration 0 Answers