- Home /
ScreentoWorldPoint position android issue
Ok, i hope i can explain my problem. I have positioned a gameobejct with ScreentoWorldPoint: GoldenCube.transform.position = camera.ScreenToWorldPoint(new Vector3(Screen.width / 5, Screen.height - 70, 0.5f)); and my problem is, that it works fine in the unity editor play mode, but if i put it on my android phone, it don't have the right x position.. It's about the middle of my screen and should be more left in the screen.
Hope someone can help me, thank you.
Answer by Dealzu-The-Wikid · Jun 30, 2014 at 11:17 PM
I believe you must also subtract half the width of the golden cube object to get the correct position. so it would be Vector3(Screen.width/5 - GoldenCubeWidth(orEstimatedwidth)/2, etc.. etc)..To move it farther left, simply subtract more.
ok sry but i don't know extactly what you mean.. my question is, why it doesn't work on android, the GoldenCube gameobject should be displayed at a fifth of the screenwidth but is displayed at a half of the display (Screen.width/5).
Your answer
Follow this Question
Related Questions
Codeless IAP not working, prompt to buy does not appear on iOS devices 1 Answer
Check if navmesh is at mouse position 0 Answers
The position of my player always returns to (0, 0, 0) 4 Answers
How to interpret Event.current.delta? 0 Answers
Unity canvas keeps changing dimension and position 0 Answers