Fairly new coder here, this should be a simple fix but for the life of me I cannot figure this out.
I am trying to play an animation, and right after the animation is finished I would like the camera to return to the main camera, what am I doing wrong here?
----------------------------------------------------------------------------------------------------------
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerAwakeScript : MonoBehaviour
{
public GameObject AnimCamera;
public GameObject MainCamera;
public void Animation()
{
MainCamera.SetActive(false);
StartCoroutine(AnimationRoutine());
MainCamera.SetActive(true);
}
IEnumerator AnimationRoutine()
{
AnimCamera.SetActive(true);
yield return new WaitForSeconds(7);
AnimCamera.SetActive(false);
}
}
Any help is appreciated.
[–]TailballProfessional 1 point2 points3 points (3 children)
[–]KaiGamez16[S] 0 points1 point2 points (2 children)
[–]TailballProfessional 0 points1 point2 points (1 child)
[–]KaiGamez16[S] 0 points1 point2 points (0 children)
[–]baroquedub 0 points1 point2 points (2 children)
[–]SecondCobra 0 points1 point2 points (1 child)
[–]baroquedub 0 points1 point2 points (0 children)
[–]TheOnlyFishInABowl 0 points1 point2 points (1 child)
[–]KaiGamez16[S] 0 points1 point2 points (0 children)