Hello all. This is my first post on the site, and I’m having some problems with Yield WaitForSeconds. I’m just plain confused and know nothing really about this. I have a script that uses iTween to switch camera positions from first person to third person. I then have another script that deactivates my first person model and activates my third person one. Switching from first to third person works fine, but when I switch back to third person, the first person and third person models activate before the camera zooms in, and I am trying to get it to wait by using WaitForSeconds. Could someone help me? Here’s my script so far:
using UnityEngine;
using System.Collections;
public class ModelActive : MonoBehaviour {
public GameObject Model;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(Input.GetKeyUp(KeyCode.Tab)) {
Model.SetActiveRecursively(true);
}
if(Input.GetKeyUp(KeyCode.LeftAlt)) {
Model.SetActiveRecursively(false);
}
}
}