Sunday, 15 November 2015

Unity 3D Mesh Renderer PopUp Message Tutorial 20155

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;

}








 ----------------------------------------­­­­­------------------------------------­-­-­-­-­-
















































0 comments:

Post a Comment