3-D Text Visible Through my Level

Hey guys, new to Unity - but I’ve read up on the basics, etc.

I want to put up a sign to a business in my 3-d world (on a building out in front of it), but when I run the game I can see the 3-D text through walls and wherever I’m at in the world. How do I fix this? It’s got be an easy fix.

3DText ignores depth- you’ll need to use a different shader that takes z-depth into consideration:

http://forum.unity3d.com/threads/9931-3D-text-that-takes-the-depth-buffer-into-account

This is answered here: 3d Text rendering over scene objetcs - Questions & Answers - Unity Discussions

Make sure the walls have materials with “Transparent/Diffuse” shaders.

I was having the same problem, with text showing through a Quad. I then changed the shader on the Quad, and the text stopped showing through. Hope this works!

I made a script so that the Mesh Renderer is de-activated if the player is a certain distance away from the object.
#pragma strict

var player : Transform;
var thing : GameObject;
var viewDist : float;
var comp : Component;

function Update () {
	if(Vector3.Distance(player.position, thing.transform.position) > viewDist){
		thing.GetComponent(MeshRenderer).enabled = false;
	} else {
		thing.GetComponent(MeshRenderer).enabled = true;
	}
}

Then attach the script to the text, and drag your player into the “Player” spot and the 3D Text into the “Thing” spot. Finally, set the viewDist variable to the distance you want the text to be visible from.

Because you say you need a sign you could you a go to GameObject → UI → Text. Then if you switch the canvas to world space you will be able to see this 2d text in your 3d scene. The solution i provide does not use 3d text but i assume it solves the problem for you.

for a ray cast from the camera to the text if it collides with something turn it off.