var rotation = Quaternion.LookRotation (player.position - transform.position);
rotation.x = 0.0f;//заморозка оси поворота x
rotation.z = 0.0f;//заморозка оси поворота z
transform.rotation = Quaternion.Slerp (transform.rotation, rotation, Time.deltaTime * 5);
public Rigidbody shoot;
void fire1 ()
{
Rigidbody rocketClone = (Rigidbody) Instantiate(shoot, transform.position, transform.rotation);
rocketClone.velocity = cannon.transform.forward *100f;
}
Instantiate(_fractions, transform);
Instantiate(_fractions, transform.position,transform.rotation);
private void Update()
{
speed += speedIncrease *Time.deltaTime;
}
public void SpawnWave()
{
int rand = Random.Range(0, wall.Lenght);
Vector3 random_value = new Vector3(Random.Range(0, 0,1f),0,0);
Instantiate(wall[rand], transform.position+random_value, Quaternion.identity);
}