Code: [Select]
if(IN_44<=0){
limbo++;
OUT_22 = 0;
if(limbo==8){
// hide the zombie
iObjectHide(zombiemesh);
}
So like that.The 3DRad community can be found at classdev.net.
//int health=100;
int limbo=0;
Vector3 spawnpoint;
int zombiemesh = OBJ_22;
int zombiechar = OBJ_88;
int zombierigid = OBJ_110;
int zombiepath = OBJ_132;
int zombie_Body = OBJ_22;
//int health = IN_44;
void Main(){
if(iInitializing()){
// spawnpoint=Vector3(x,y,z,"xyz");
//spawnPoint[1]=Vector3(x,y,z,"xyz");
//spawnPoint[2]=Vector3(x,y,z);
iObjectLocationSet(zombiemesh,Vector3(-35,3,-10));
}
//get health
if(IN_45<=0){
limbo++;
OUT_22=0;
if(limbo==8){
iObjectHide(zombiemesh);
iObjectHide(zombiechar);
iObjectHide(zombierigid);
iObjectHide(zombiepath);
}
if(limbo>=8){
limbo=0;
OBJ_45=100;
iObjectLocationSet(zombiemesh,Vector3(-35,3,-10));
iObjectReset(zombiemesh);
}
}
}
And it seems to be working so far. But everytime I run it and go back to editing the ValuePrint is missing from the Object Handles list and I have to make a new valuePrint everytime. I tried un-attaching and re-attaching the ValuePrint but it doesn't show up???int health=100;
int respawn_delay=0;
bool respawn = false;
Vector3 location;
int zombiemesh = OBJ_22;
int zombiechar = OBJ_88;
int zombierigid = OBJ_110;
int zombiepath = OBJ_132;
int zombie_Body = OBJ_22;
int zombiedeath = OBJ_286;
int zombiesound = OBJ_154;
int zombiecounter = OBJ_264;
void Main(){
if(IN_487 > 0 ){
health -= 50;
}
if(health<=0){
respawn_delay++;
if(respawn_delay==8){
iObjectHide(zombiemesh);
iObjectStop(zombiemesh);
iObjectStop(zombiechar);
iObjectHide(zombierigid);
iObjectStop(zombiepath);
iObjectStop(zombiesound);
OUT_24 = 3;
respawn = true;
}
}
if(respawn == true){
if(respawn_delay>=200){
respawn_delay=0;
health=100;
iObjectShow(zombiemesh);
iObjectStart(zombiepath);
iObjectStart(zombiesound);
iObjectStart(zombiechar);
iObjectShow(zombierigid);
iObjectReset(zombiecounter);
iObjectLocationSet(zombiemesh,Vector3(-20,3,-10));
OUT_22 = 1;
}
}
}
So far thats working when he dies it waits 200ms. Then it starts every part up again..but it doesn't reset the location..it continues from were it died at. iObjectLocationSet(zombiemesh,Vector3(-20,3,-10));
the mesh is linked to a character rigidbody...Yea, Robertoo informed me of this Thanks a lot. I got him to spawn in random locations. Much obliged.
it'll always stay with the rb...
you've gotta reposition the rb, not the mesh... in this line of code below...Code: [Select]iObjectLocationSet(zombiemesh,Vector3(-20,3,-10));
--Mike