// 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 = -Input.acceleration.y;
dir.z = Input.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);
}
Video Tutorial How to use it :
http://www.youtube.com/watch?v=FjXAcMAE_C4&feature=youtu.be
četvrtak, 9. svibnja 2013.
Video Tutorials
Yooo this is first video tutorial about unity 3d android development :
http://www.youtube.com/watch?v=r6hAW6s_Xfc
I will post one more video on this chanell about scripting simple game for android with sensor motion and it will look like this :
http://www.youtube.com/watch?v=I7ShTo3lGT4
http://www.youtube.com/watch?v=r6hAW6s_Xfc
I will post one more video on this chanell about scripting simple game for android with sensor motion and it will look like this :
http://www.youtube.com/watch?v=I7ShTo3lGT4
srijeda, 8. svibnja 2013.
Project Settings
Welcome to first tutorial from tech freak . So first start new project and enter build settings you will get this :
First dont forget to add your scene so click on add current and when your scene name is checked click on android mobile phone icon and click switch platform . After switching platform you need to change player settings so click on Player Settings and you will get next screen :
Product Name on this place you will put name of your app and company name also you must put icon for your app when you done with this you go on Icon tab and you will get this screen :
So you put icon to fit android phones and proceed to next tab Splash Image :
On Splash Image tab you choose your company logo which will appear when app is started on android phone when you finish with this go on next tab Publish Settings and you will get this :
Bundle Identifier must be unique if you are publishing on google market so put your company name like this - com.yourcompanyname.nameofgame next thing you will do is setting up Minimum API Level for your app I choose Android 2.1 API level 7 because I test my apps on xperia x10 mini but you can choose your android . When you finish with API Level you are going to choose Device Filter I also choose ARMv6 because my xperia is running this , and that is because my xperia is older android phone but newer versions of android phones are with ARMv7 . So on finish you can adjust your Resolution and Presentation by going on Res and Pres tab and this screen will appear :
Setup Default Orientation* to Landscape Right because all device run on this settings .
That was it for this post in second post I will show you how to make simple game for android but that tutorial will be uploaded on youtube .
Pretplati se na:
Postovi (Atom)