- Home /
Question by
Gooeygamer · Jan 17, 2019 at 03:41 AM ·
camera2dpositon
If i change the position of the camera, the camera view stays the same..
???? I have no idea why this happens.. There is only one camera.. It's the main camera. I am definetely moving the camera, I've even had a look to see if the position is changing, and it definetely is.. Here is the script, just incase I did something wrong: using System.Collections; using System.Collections.Generic; using UnityEngine;
public class MenuOperator : MonoBehaviour {
public Camera mainCam;
private void Start()
{
mainCam = Camera.main;
}
public void TeleportCamera(int MenuID)
{
/// Main Menu = 0
/// Shop Menu = 1
if (MenuID == 0)
{
mainCam.transform.position = new Vector3(0, 0, -10);
}
if (MenuID == 1)
{
mainCam.transform.position = new Vector3(400, 0, -10);
}
}
}
Comment
Answer by cs120319992 · Jan 18, 2019 at 02:01 PM
If is 2D , and you use canvas, it is clear that will not change