- Home /
Question by
maricx · Apr 30, 2012 at 07:43 PM ·
photonspawndestroy object
Help Scripts
HY I make a multiplayer fps game and i have something problems My questions: 1.I have a GUI BUTTON with name :Armata ... how to make when I click at this to destroy camera object (name:"Armata") and spawn my character somewhere
2.My character has health DesplayHealth.js:
static var desplay = 100;
function OnGUI () {
GUI.Label (Rect (10, 200, 100, 20),"Health:" + desplay);
}
Network Health.js:
var Tag = "bullet";
static var health = 100;
var useScript = false;
static var dead = false;
var bigbullethurt = 50;
function OnTriggerEnter (player){
if(useScript==true){
if(player.gameObject.tag == "Bullet"){
health -=bigbullethurt;
}
}
}
function Update (){
if(useScript==true){
DesplayHealth.desplay = health;
}
if(health <1){if(useScript == true){
DesplayHealth.desplay = health;
dead = true;
health = 100;
}
}
}
function OnGUI (){
}
function OnNetworkInstantiate (msg : NetworkMessageInfo) {
if(networkView.isMine == true){
DesplayHealth.desplay = health;
useScript = true;
RespawnNetwork.Player=transform;
}
else{
useScript = false;
}
}
***How to make when i fire at player to apply damage?***
3.Why photon(exitgames) don't work(not run)?please a tutorial:D
PS:Sorry for my bad english...
Comment
Your answer
Follow this Question
Related Questions
Is possible to spawn 2d image in photon networking ? 1 Answer
Unity photon multiplayer teams 3 Answers
How to manually destory GameObjects on player leaving game in Photon 1 Answer
Born again object 1 Answer
Player Instantiate won't work 2 Answers