简体   繁体   中英

Conversion of coordinate systems. Unity. 2D

2D Game.

Given specific points(x,y) both vary from 0 to 600. From the topleft corner.

How to covert the view so all instantiated objects wouldnt just appear in one corner. It would adjust to the camera.(the aspect ration)

Hard to answer questions without details. But you probably need to try

Instantiate(YourGameObject, Camera.main.transform.position);

to create a game object at camera's position, to move right/left and up/down just add another vector to the second parameter.

If you wanna use normalized coordinates just map them by manipulating the equation A1 / A2 = B1 / B2 , but it's harder and you shouldn't.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM