buenas tengo un problema.
Al instanciar un zombie que hice desde blender, este coge una rotación en el eje x la cual no es la predeterminada (0). He
que podría estar ocurriendo??
Os dejo el script del zombie por si el error esta ahí.
y por aquí el del instanciador
Gracias
Al instanciar un zombie que hice desde blender, este coge una rotación en el eje x la cual no es la predeterminada (0). He
que podría estar ocurriendo??
Os dejo el script del zombie por si el error esta ahí.
public class Enemigo : MonoBehaviour {
private float vida = 100f;
public float velocidadMovimiento;
GameObject Player;
void Awake(){
Player = GameObject.FindWithTag ("Player");
}
void Update(){
this.transform.LookAt (this.Player.transform.position);
this.transform.Translate (Vector3.forward * this.velocidadMovimiento * Time.deltaTime);
if (vida <= 0f) {
Muerte ();
}
}
void Muerte(){
Destroy (gameObject);
}
public void Vida (float amount) {
vida -= amount;
if (vida <= 0f) {
Muerte ();
}
}
public void sonido()
{
}
}
y por aquí el del instanciador
public class InstanciadorZombie : MonoBehaviour {
public GameObject instanciadorZombies;
public GameObject Zombie;
private int numZombiesMax = 5;
int numZombiesMin = 0;
public float TiempoEntreZombie;
private float TiempoUltimoZombie;
void Update(){
Instanciador ();
}
public void Instanciador(){
if (numZombiesMin < numZombiesMax && Time.time - TiempoUltimoZombie >= TiempoEntreZombie) {
Instantiate (this.Zombie, this.instanciadorZombies.transform.position, this.instanciadorZombies.transform.rotation);
numZombiesMin++;
TiempoUltimoZombie = Time.time;
if (numZombiesMin == numZombiesMax) {
Invoke ("MasZombies", 20f);
}
}
}
public void MasZombies(){
numZombiesMax = numZombiesMax + 5;
}
}
Gracias