Hi there,
I’m just starting and have a question about the camera.
I want to look from the top onto my terrain/plane with a little angle … like 2,5D.
When I move my mousecursor e.g. to the left side of the screen then the camera shall scroll to the left.
This is so far I have but maybe my MainCamera has the wrong angle.
Or I have the wrong axis because I can move to left and right but not forward or backward.
//JavaScript
function Update () {
var screenBorderLeft : float = Screen.width * 0.01f;
var screenBorderRight : float = Screen.width * 0.99f;
var screenBorderTop : float = Screen.height * 0.01f;
var screenBorderBottom : float = Screen.height * 0.99f;
if (Input.mousePosition.y <= screenBorderLeft)
{
print("ScreenWidth: " + Screen.width + " --> * 0.01 " + screenBorderLeft);
print("left" + Input.mousePosition.y);
}
if (Input.mousePosition.y >= screenBorderRight)
{
print("right" + Input.mousePosition.y);
}
if (Input.mousePosition.x <= screenBorderTop)
{
print("ScreenHeight: " + Screen.width + " --> * 0.01 " + screenBorderTop);
print("top" + Input.mousePosition.y);
}
if (Input.mousePosition.x >= screenBorderBottom)
{
print("bottom" + Input.mousePosition.y);
}
}
I can get nearly all directions but not the right direction.