- Home /
Place GameObject above screen
I was wondering what the formula would be to place an object perfectly off the screen rather then punching in a predefined value. Or if it can be done. I have a play with.
Screen.height Screen.currentResolution.height / 2;
The above 2 place the object way above the screen :0
I know I also need to probably add the GameObjects Scale/Height in some how.
Answer by IJM · Nov 23, 2010 at 08:14 AM
To do something like that you can use ScreenToWorldPoint:
http://unity3d.com/support/documentation/ScriptReference/Camera.ScreenToWorldPoint.html
Thanks a bunch. Fooled around with it and it seems to work fine.
Your answer
Follow this Question
Related Questions
So much problem with screen.width camera.pixelwidth and responsive design 0 Answers
overlap between scenes!!! 1 Answer
GameObject width in screen space 1 Answer
Screen wrap code works for player but not all instantiated gameobjects. 1 Answer
How to Get Gameobject position on screen resolution that not passed the resolution to set 0 Answers