Hi there, Would you be so kind and check image attached? Our "hero" (light cube) is on the center of stage. I want to create enemies on 2 sides (dark cubes). How to find out correct position? For the enemy # 1 I was trying with: Camera.main.ViewportToWorldPoint (0,1); enemy #8 Camera.main.ViewportToWorldPoint (0,0); Is that correct approach? thanks
Can you just instantiate the enemies where the boxes positions are? Or are you doing something more advanced like spawning an enemy wherever the player clicks? Not quite sure what's going on.
Hi there, I want to instantiate enemies at the top and at the bottom of current camera view. I can not use boxes positions.
Can you parent the boxes to the camera so they will go along with the camera view? I dont know how to get a position on a cameras field of view.
Hi there, I have found out. Following code was what I was looking for: Vector3 viewportPos = new Vector3(0,0, Camera.main.transform.position.z); Vector3 worldPos = Camera.main.ViewportToWorldPoint(viewportPos);