- Home /
Putting object at the edge of the screen irrespective of resolution
In the game view, I put that cylinder at the edge of the screen. When I enter play mode, it does not remain at the edge! How to do this?
I am having hard time solving this. ScreenToWorldPoint, viewport, viewport.pixelWidth, viewport.pixelHeight- I just cannot make them work.
Answer by Tona999 · Mar 16, 2017 at 08:32 PM
Try using a canvas, you can find it in the UI components menu. Add a canvas scaler on the canvas itself and set the camera reference where needed. Take a look at this: https://docs.unity3d.com/Manual/UICanvas.html
Answer by dakshesh1010 · Mar 16, 2017 at 08:14 AM
Because you're playing it in Free Aspect. Fixate on some resolution like 16:9 or 16:10 and then adjust the cylinder the way you want. If this cylinder should stay there all the time, make it child of the camera.