I figured it out. :P
Acceleration input math problem.
Currently I have: The movement speed of my character is multiplied by a variable defined by the tilt acceleration + 1. So when I tilt the phone forward (beyond 0, where 0 is "sitting flat on a table") the movement speed increases.
What I want: The movement speed to increase, where the smallest value is when the accelerometor reports -1 (held upright in landscape left) and the greater values (increasing the movement speed more) when the accelerometer is closer to 0 (0 being "laying flat on a table", which relative to how most people hold their phone, is "tilted forward").
Mathematical dillema: Multiplying by absolute value does convert the tilt to affect the movement speed, but I'm still leaning the phone back to go faster, which isn't what I want.
I can add another 1 to the negative value but it still reports smaller values the closer it is to 0.
It sounds farfetched, but is there something I can do to sort of, invert the absolute value for what I'm trying to do?
TiltModifier = Mathf.Abs(Input.acceleration.y) + 1;
anim.SetFloat ("Tilt", TiltModifier);
float movespeed = moveJoystick.InputDirection.z + (TiltModifier * 2);
anim.SetFloat ("movespeed", movespeed - (TiltModifier * 2));
Never$$anonymous$$d! The solution was, and maybe verbosely, to define another variable, define it as -1 + the absolute value of the Y acceleration, and then define the tilt modifier variable as that value plus 1.
Follow this Question
Related Questions
Problem with input axis "Submit" 1 Answer
Custom input not appearing in input manager 0 Answers
Google Cardboard Look Axis are the Opposite. 0 Answers
I am showing double on screen and it disappear 1 Answer
Having terrible trouble with GUIText 0 Answers