Advertisemen
Unity 3D Mesh Renderer PopUp Message Tutorial 20155
DIRECT DOWNLOAD HERE
THIS IS BACKUP IN TEXT FORM
1. Create New java and name it : MeshRendererPopUp
2. Copy & Past this text and save java :
---------------------------------------------------------------------------------
#pragma strict
var player: Transform;
var showOnDistance: float = 2;
private var meshRenderer: MeshRenderer;
//----------------------------------------------------------------------------------
function Start ()
{
meshRenderer = gameObject.GetComponent(MeshRenderer);
}
//----------------------------------------------------------------------------------
function Update ()
{
if (Vector3.Distance(transform.position, player.position) < showOnDistance)
meshRenderer.enabled = true;
else
meshRenderer.enabled = false;
}
---------------------------------------------------------------------------------
Advertisemen
Tidak ada komentar:
Posting Komentar