Hi, I am developing a game on Unity for Android platform. I have run into a basic issue and the question might sound a little stupid to the experts around here. I’ll keep it crisp and to the point.
-
Does the world coordinate EVER change if I JUST change the camera coordinates? Meaning, If I move my camera right, the world coordinates of the original objects will be the same and the screen coordinates will keep changing. Is this understanding correct?
-
I have a variable
var player : Vector3;
When I assign position to this vector, I see a weird behaviour.
player = gameObj_2.GetComponent(Player).transform.position
This puts the player somewhere in the middle of the screen (wherever it was just before this line got executed)
BUT
player = gameObj_2.GetComponent(Player).transform.position + newVector3(0.2,0,0);
This brings the player to the left end of the screen. What is weird is gameObj_2.GetComponent(Player).transform.position.x is positive. So when I add something, it should most definitely move to the right but it is moving to the left. Isn;t this a simple vector addition?
Few more points to help you assess -
- The camera is constantly moving to the right at a constant speed.
- This is all in 2D.
Any help will be appreciated. Let me know if there is more information required.