using System.Collections; using System.Collections.Generic; using UnityEngine; public class MyEvents : MonoBehaviour { public Transform player; public Animator fadeAnim; public void GoWait(Transform pos) { StartCoroutine(GoWaitCoroutine(pos)); } IEnumerator GoWaitCoroutine(Transform pos) { fadeAnim.SetTrigger("HideAndShow"); yield return new WaitForSeconds(0.5f); player.GetComponent().enabled = false; player.position = pos.position; player.rotation = pos.rotation; player.GetComponent().enabled = true; } }