- Home /
Question by
ThiagoKoster · Nov 08, 2016 at 10:22 AM ·
androidscripting problemwhite
Script in Camera turning objects white
Hi guys, Today I was testing my project on an Android device and I noticed that all objects turn white on screen. That problem wasn't happening in the editor. So after some tests I removed the script that was in the MainCamera and the problem disappeared.
Here is a screenshot of the android device (Sony Xperia Z2):
And here is the camera script:
using UnityEngine;
using System.Collections;
public class CameraFollowPlayer : MonoBehaviour {
public GameObject target;
Vector3 pos;
void Start(){
Camera.main.orthographic = true;
Camera.main.transform.rotation = Quaternion.Euler(30, 45, 0);
pos = target.transform.position;
}
void LateUpdate () {
float distance = 1000;
Vector3 cameraDistance = new Vector3 (-distance, distance, -distance);
Camera.main.transform.position = Vector3.Lerp(transform.position, target.transform.position + cameraDistance, 1f * Time.deltaTime);
Camera.main.transform.LookAt (target.transform);
}
}
So I wanted to know what is causing the problem in the script. Thanks!
Comment