Unity Switch from one player to another !

Advertisemen

Simple Unity  On trigger enter  Switch from one player to another !












DIRECT DOWNLOAD HERE








THIS IS BACKUP  IN TEXT FORM   Script1

1. Create New java and name it : DISABLEPLAYER1


2. Copy & Past this text and save java :
----------------------------------------­­­­­------------------------------------­-­-­-­-­-


#pragma strict


var Obj : GameObject;

function Start () {



}

function OnTriggerEnter (trigger:Collider) { if(trigger.collider.tag=="Player1") Obj.SetActive (false); 


  DontDestroyOnLoad (gameObject);
}
 


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










THIS IS BACKUP  IN TEXT FORM   Script2

1. Create New java and name it : ENABLEPLAYER2


2. Copy & Past this text and save java :
----------------------------------------­­­­­------------------------------------­-­-­-­-­-


#pragma strict

var Obj : GameObject;

function Start () {

Obj.SetActive(false);

}

function OnTriggerEnter (trigger:Collider) { if(trigger.collider.tag=="Player1") Obj.SetActive (true); 


  DontDestroyOnLoad (gameObject);
}
 


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

























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