Ok this is my second attemp in writting this
… First of I am completly new… and I want to creat my first Andorid game.
I startet with a couple of tutorials and even managed to make some small tests run on my phone but now I am trying something I never did bevor, I tried to do it myself but I get one error after another… I am really desperate for every little help I can get.
First of
I want my Player (A Ball) to move right when you tilt the Phone to the right side.
Left when you till it to the left side.
And Jump when you shake it and or touch it (The screen)
Prohblem is I don’t even get to the point where it starts moving at all…
This is my first try with sensors and just the simple movments are making me itchy. I would really love if somone could help me a bit or at least tell me if my thinking is totally wrong or not.
This here is my Code:
#pragma strict
var rotationSpeed = 100;
function Update ()
{
var rotation : float = Input.acceleration ("Horizontal") * rotationSpeed;
rotation *= Time.deltaTime;
rigidbody.AddRelativeTorque (Vector3.zero * rotation);
}
well it works for keyinput controlls if I would change a segment but I have no Idea about acceleration…
Simply I want the ball to go faster the more I tild the Phone… What is wrong with my Thinking?