using UnityEngine;
using System.Collections;
public class spawning : MonoBehaviour {
public GameObject enemy;
// Use this for initialization
void Start () {
StartCoroutine (spawningg ());
}
// Update is called once per frame
void Update () {
}
IEnumerator spawningg()
{
while (true) {
float second = Random.Range (2,4);
yield return new WaitForSeconds (second);
Instantiate (enemy, transform.position, Quaternion.identity);
// Debug.Log (second);
}
}
}
This code instantiates object within 2 second but problem is that when it instantiates it has rotation of 0,0,0 but prefab has set rotation of 0,0,180 so it looks down , when object is instantiated it dosent rotate Thans in advance for help.
Wait a sec. Aren't we trying to get more specific questions here on UA instead of too general ones? I would consider this question a prime-example of a proper question
– Bunny83