- Home /
Can I change movement from Unity 3d into Unity 3D iOS
Hi i'm newbie please suggest me about how to adapt control of movement in Unity 3D into iOS device any one who want to help me and any one who have informations about development of iOS version please tell me :) Thanks so much .
Answer by mohanrao164 · Aug 30, 2011 at 05:27 AM
if u want to using buttons use this it will work in unity 3d and ios
void OnGUI()
{
if(GUI.RepeatButton(new Rect(Screen.width/10,Screen.height/1.5f,Screen.width/15,Screen.height/10),"up"))
{
transform.Translate(Vector3.forward*Time.deltaTime*50);
}
if(GUI.RepeatButton(new Rect(Screen.width/10,Screen.height/1.15f,Screen.width/15,Screen.height/10),"down"))
{
transform.Translate(Vector3.back*Time.deltaTime*50);
}
if(GUI.RepeatButton(new Rect(Screen.width/40,Screen.height/1.3f,Screen.width/15,Screen.height/10),"left"))
{
transform.Rotate(Vector3.down, 90*Time.deltaTime);
}
if(GUI.RepeatButton(new Rect(Screen.width/5.6f,Screen.height/1.3f,Screen.width/15f,Screen.height/10),"right"))
{
transform.Rotate(Vector3.up, 90*Time.deltaTime);
}
}
other wise, u can use joystick for the movement in ios. the standard package is present in standard assets mobile in the unity itself.
so u try it once.
In menu->assets->import package->standard assets(mobile)
When i add your code It warn Assets/NewBehaviourScript.js(4,67): BCE0044: expecting ), found 'f'. How can I resolve that Thx
actually it is not js script it is cs script. try it in the c# script. u will definetly get it
Answer by panorama · Aug 30, 2011 at 05:30 AM
I will be code in I appreciate in your kindness dude Thx a lot.