Unity 3D Mesh Renderer PopUp Message Tutorial 20155

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

Disclaimer: Gambar, artikel ataupun video yang ada di web ini terkadang berasal dari berbagai sumber media lain. Hak Cipta sepenuhnya dipegang oleh sumber tersebut. Jika ada masalah terkait hal ini, Anda dapat menghubungi kami disini.

Tidak ada komentar:

Posting Komentar

© Copyright 2017 Tutorial Unity 3D