Reputation: 131
I'm trying to make a 2D game. I have 4 gameobjects which i want to place in each corner of the screen., i.e when I run my app on my phone it should be visible in each corner. So what I did in the script is,
//GameObject 1 script
void Start(){
transform.position = Camera.main.ScreenToWorldPoint(new Vector2(Screen.width, Screen.height));
}
//GameObject 2 script
void Start(){
transform.position = Camera.main.ScreenToWorldPoint(new Vector2(0, 0));
}
//And same for other 2 gameobjects...
But i am not seeing any of the objects on my screen.
Upvotes: 0
Views: 57
Reputation: 1323
You're doing it in right way, but there could be some moments you should check out:
renderer.bound
for this purpose.Upvotes: 1