- Home /
2d top down Camera help
I have a script:
using UnityEngine;
using System.Collections;
public class CameraMovement : MonoBehaviour {
public Transform target;
void Update () {
gameObject.transform.position = target.position;
}
}
But, nothing ever renders even with sprites on the screen. Any ideas?
Please provide more information. What do you mean, nothing renders? Have your checked the camera's culling mask? It's near and far clipping planes? It's depths, if there are other cameras? Are any image effects on the camera? Does the camera move as it should?
Answer by malkere · Jul 03, 2015 at 02:28 PM
you're setting the camera location to the target location. you should set it to new Vector3(target.position.x, target.position.y + 10, target.position.z). and make sure it's facing down. otherwise you're inside you're target.
Cherno is pointing out the near clipping plane. if set to 0.3, anything closer than 30cm to the camera will -not- draw. you can turn that down, but it's better to back the camera up.
Your answer
Follow this Question
Related Questions
Passing Underneath Section of a Mesh 0 Answers
Camera looking down 1 Answer
2D Top Down Camera Smoothing 1 Answer
Display 1 No cameras rendering when player collides with enemy 1 Answer