- Home /
How to move a GameObject into scene
I have placed a gameObject into scene and linked it to ArCamera as a child.The problem is that the gameObject is in a little different position onto ipad screen against its position on iphone screen.SO how can i correctly position the object,maybe progamatically?
I tried something like
void Start () { //the y-coordinate of the first third part of the height screen float ThirdPart = Screen.height / 3F; ThirdPart = ThirdPart* 2F + ThirdPart / 2F; transform.position = new Vector3(Screen.width/2, ThirdPart, transform.position.z); Debug.Log(transform.position); }
into a script attached to the gameObject,which is as I said before a child of Arcamera and it completely disapeared from the screen.What is wrong?
Answer by Screenhog · Aug 02, 2012 at 06:45 PM
Different position on iPhone compared to iPad? Could it be because of aspect ratio? An iPad has an aspect ratio of 4:3, but an iPhone has an aspect ratio of 3:2, meaning that the exact same camera will be able to render some things on one device that would be just outside of the field of view on the other device.
Oh, and please put the code tag around your code (the button that says 101010 when editing a post). It makes it more readable.
Your answer
![](https://koobas.hobune.stream/wayback/20220613075058im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Android Communication 1 Answer
Compiling in Xcode? 0 Answers
Can I publish a game to iOS without purchasing the iOS addon? 2 Answers