1). I just got unity iphone basic and was wondering where good resources are and good tutorials.
2). What is the code in C# to work the accelerometer?
3). On the iphone unity basic how do you make an fps character shoot with a button and move around with 2 arrows but go back and forth with accelerometer?
I know there a lot of questions but please answer.
this is a fps tutorial for unity not unity iphone .
http://unity3d.com/support/resources/files/Complete%20FPS%20Tutorial.zip
to move a chacater whit accelerometer
// Move object using accelerometer
var speed = 10.0;
function Update () {
var dir : Vector3 = Vector3.zero;
// we assume that device is held parallel to the ground
// and Home button is in the right hand
// remap device acceleration axis to game coordinates:
// 1) XY plane of the device is mapped onto XZ plane
// 2) rotated 90 degrees around Y axis
dir.x = -iPhoneInput.acceleration.y;
dir.z = iPhoneInput.acceleration.x;
// clamp acceleration vector to unit sphere
if (dir.sqrMagnitude > 1)
dir.Normalize();
// Make it move 10 meters per second instead of 10 meters per frame...
dir *= Time.deltaTime;
// Move object
transform.Translate (dir * speed);
}
For example of controls without the shooting, check out Unity - Manual: Getting started with iOS and download the OcclusionCulling.zip.