I’m on the TileVania course and I wanted to code in when the player collides with the exit it could spin and appear to shrink into the exit sprite. Not sure where I would start on this one. How would I code this?
This is my current LevelExit sprite script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;public class LevelExit : MonoBehaviour
{
[SerializeField] float LevelLoadDelay = 2f;void OnTriggerEnter2D(Collider2D other) { StartCoroutine(LoadNextLevel()); } IEnumerator LoadNextLevel() { yield return new WaitForSecondsRealtime(LevelLoadDelay); var currentSceneIndex = SceneManager.GetActiveScene().buildIndex; SceneManager.LoadScene(currentSceneIndex + 1); }
}