Quantcast
Channel: Latest Questions by lamxung55
Viewing all articles
Browse latest Browse all 12

Align object to bottom left of the screen

$
0
0
Align object to bottom left of the screen Hi bros, I want to put my sprite object ( maybe an object in general) to bottom left of the screen, the left edge of object will abut to the left edge of screen As people advice I use ScreenToWorldPoint function like this: Vector3 worldPoint = Camera.main.ScreenToWorldPoint(new Vector3(0, 0, 5)); myGameObject.transform.position = worldPoint; and like this: Vector3 worldPoint = Camera.main.ScreenToWorldPoint(new Vector3(gameObject.GetComponent().bounds.size.x/2, gameObject.GetComponent().bounds.size.y/2, 5)); But both of them does not return a result like I expect. You can see my picture ![alt text][1] What must I do? Do I miss something here? Thank you so much! [1]: /storage/temp/36770-align.jpg

Viewing all articles
Browse latest Browse all 12

Latest Images

Trending Articles





Latest Images