- Home /
Question by
Jasmin1347 · Jul 25, 2018 at 09:12 AM ·
androidrotationmovemobile devicesmovements
player Movement using acceleration
How to move and rotate player forward,backward using Input.acceleration?
Comment
Answer by tormentoarmagedoom · Jul 26, 2018 at 06:44 AM
Good day.
Acceleration is a read only property. What do you want to get by using acceleration value? If want to move, you have to change its transform position or translate, or by using a rigid body... But acceleration is only positive if you are already changing its velocity amgnitude or direction.
Bye
Answer by dongbyb · Jul 26, 2018 at 07:25 AM
maybe like this:
float x=Input.acceleration.x;
float y = Input.acceleration.y;
float z = Input.acceleration.z;
Vector3 moveVec = new Vector3(x,y,z);
i want to move and rotate player in forward,backward, left,right direction like flyboard.