Forum begins after the advertisement:


Search Results for 'fader'

Home Forums Search Search Results for 'fader'

Viewing 15 results - 46 through 60 (of 77 total)
  • Author
    Search Results
  • #13954
    Pete
    Participant

    I think that i better to show you my situation with screenshots and video

    and in canvas prefab, I can’t attach SceneFader.cs on UIManager…

    “Player Inspector”



    “UIManager Inspector”

    “SceneTransition Inspector”

    “Error Console”


    #13940
    Joseph Tang
    Moderator

    In regards to the camera, can you check if your Camera parent or any object has the CameraManager.cs script on it? I feel that likely the errors in the PlayerController.cs is a separate issue where it cannot find an instance of the CameraManager.cs

    As for your SceneTransition, check that your Canvas Prefab has a UIManager.cs attached to it & the “Scene Fader” assigned appropriately to it. Then ensure that the SceneFader game object in the Canvas is set to Active as an inactive one will be taken as a null.

    Otherwise, if both situations don’t work, could you taking some screenshots of the inspector of your UIManager, Player, SceneTransition inspectors & a video or console of what happens when you transition scenes?

    As a side note, I noticed that your SceneTransition.cs calls SceneManager.LoadScene(transitionTo); in the private void OnTriggerEnter2D(Collider2D _other) method before the StartCoroutine. You should not need the LoadScene() code itself as the coroutine you are casting will activate both the fade and LoadScene() already.

    #13938
    Pete
    Participant

    Thanks for your reply.

    But blog.terresquall.com/community/topic/part-5-my-scenefader-cannot-function/ this case doesn’t work for me…

    and try to solve with Youtube video, it also doesn’t work…

    so i’ll bold all the line the error is occuring.

    “SceneTransition.cs”

    using System.Collections;
    using System.Collections.Generic;
    using UnityEditor.Build.Content;
    using UnityEngine;
    using UnityEngine.SceneManagement;
    
    public class SceneTransition : MonoBehaviour
    {
    [SerializeField] private string transitionTo; //Represents the scene to transition to
    
    [SerializeField] private Transform startPoint; //Defines the player's entry point in the scene
    
    [SerializeField] private Vector2 exitDirection; //Specifies the direction for the player's exit
    
    [SerializeField] private float exitTime; //Determines the time it takes for the player to exit the scene transition
    
    // Start is called before the first frame update
    private void Start()
    {
    if (GameManager.Instance.transitionedFromScene == transitionTo)
    {
    PlayerController.Instance.transform.position = startPoint.position;
    
    StartCoroutine(PlayerController.Instance.WalkIntoNewScene(exitDirection, exitTime));
    
    }
    
    StartCoroutine(UIManager.Instance.sceneFader.Fade(SceneFader.FadeDirection.Out));
    }
    
    private void OnTriggerEnter2D(Collider2D _other)
    {
    if (_other.CompareTag("Player"))
    {
    GameManager.Instance.transitionedFromScene = SceneManager.GetActiveScene().name;
    
    PlayerController.Instance.pState.cutscene = true;
    
    SceneManager.LoadScene(transitionTo);
    
    StartCoroutine(UIManager.Instance.sceneFader.FadeAndLoadScene(SceneFader.FadeDirection.In, transitionTo));
    }
    }
    }

    “PlayerController.cs”

    void Update()
    {
    if (pState.cutscene) return;
    
    GetInputs();
    UpdateJumpVariables();
    UpdateCameraYDampForPlayerFall();
    RestoreTimeScale();
    
    if (pState.dashing) return;
    Flip();
    Move();
    Jump();
    StartDash();
    Attack();
    FlashWhileInvincible();
    Heal();
    CastSpell();
    }
    
    void UpdateCameraYDampForPlayerFall()
    {
    //if falling past a certain speed threshold
    if(rb.velocity.y < playerFallSpeedThreshold && !CameraManager.Instance.isLerpingYDamping && !CameraManager.Instance.hasLerpedYDamping)
    {
    StartCoroutine(CameraManager.Instance.LerpYDamping(true));
    }
    //if standing still or moving up
     if(rb.velocity.y >= 0 && !CameraManager.Instance.isLerpingYDamping && CameraManager.Instance.hasLerpedYDamping)
    {
    //reset camera function
    CameraManager.Instance.hasLerpedYDamping = false;
    StartCoroutine(CameraManager.Instance.LerpYDamping(false));
    }
    }
    #13932
    Terence
    Keymaster

    Hi Pete, for the SceneFader, can you check this topic and see if it fixes your issue? https://blog.terresquall.com/community/topic/part-5-my-scenefader-cannot-function/

    I’ll need you to bold the line the error is occurring on for your PlayerController script. The null reference exception is specific to certain lines.

    You may also find this video useful:

    Pete
    Participant

    Hi, I have a trouble on part 6.

    I just followed “Camera Bounds” & “Dynamic Camera Y Damping” and when I try to run the game, it just pauses and there are repetitive error msg on console.

    NullReferenceException: Object reference not set to an instance of an object
    SceneTransition.Start () (at Assets/Scripts/SceneTransition.cs:27)

    NullReferenceException: Object reference not set to an instance of an object
    PlayerController.UpdateCameraYDampForPlayerFall () (at Assets/Scripts/PlayerController.cs:253)
    PlayerController.Update () (at Assets/Scripts/PlayerController.cs:184)

    NullReferenceException: Object reference not set to an instance of an object
    PlayerController.UpdateCameraYDampForPlayerFall () (at Assets/Scripts/PlayerController.cs:258)
    PlayerController.Update () (at Assets/Scripts/PlayerController.cs:184)

    I don’t know how to deal with “NUllReferenceException” error.

    this is my error console img below.

    “Scenetransition.cs”

    public class SceneTransition : MonoBehaviour
    {
        [SerializeField] private string transitionTo; //Represents the scene to transition to
    
        [SerializeField] private Transform startPoint; //Defines the player's entry point in the scene
    
        [SerializeField] private Vector2 exitDirection; //Specifies the direction for the player's exit
    
        [SerializeField] private float exitTime; //Determines the time it takes for the player to exit the scene transition
    
        // Start is called before the first frame update
        private void Start()
        {
            if (GameManager.Instance.transitionedFromScene == transitionTo)
            {
                PlayerController.Instance.transform.position = startPoint.position;
    
                StartCoroutine(PlayerController.Instance.WalkIntoNewScene(exitDirection, exitTime));
            }
            
            StartCoroutine(UIManager.Instance.sceneFader.Fade(SceneFader.FadeDirection.Out));
        }
    
        private void OnTriggerEnter2D(Collider2D _other)
        {
            if (_other.CompareTag("Player"))
            {
                GameManager.Instance.transitionedFromScene = SceneManager.GetActiveScene().name;
    
                PlayerController.Instance.pState.cutscene = true;
    
                SceneManager.LoadScene(transitionTo);
    
                StartCoroutine(UIManager.Instance.sceneFader.FadeAndLoadScene(SceneFader.FadeDirection.In, transitionTo));
            }
        }
    }
    

    “PlayerController.cs”

    
    void Update()
    {
        if (pState.cutscene) return;
    
        GetInputs();
        UpdateJumpVariables();
        UpdateCameraYDampForPlayerFall();
        RestoreTimeScale();
    
        if (pState.dashing) return;
        Flip();
        Move();
        Jump();
        StartDash();
        Attack();
        FlashWhileInvincible();
        Heal();
        CastSpell();
    }
    void UpdateCameraYDampForPlayerFall() 
    {
        //if falling past a certain speed threshold
        if(rb.velocity.y < playerFallSpeedThreshold && !CameraManager.Instance.isLerpingYDamping && !CameraManager.Instance.hasLerpedYDamping)
        {
            StartCoroutine(CameraManager.Instance.LerpYDamping(true));
        }
        //if standing still or moving up
        if(rb.velocity.y >= 0 && !CameraManager.Instance.isLerpingYDamping && CameraManager.Instance.hasLerpedYDamping)
        {
            //reset camera function
            CameraManager.Instance.hasLerpedYDamping = false;
            StartCoroutine(CameraManager.Instance.LerpYDamping(false));
        }
    }
    
    Joseph Tang
    Moderator

    Question 1: Slash effect sprite not properly changing directions.

    By right, the normal code should work as the way it works is that for your side attacks, they are calling Instantiate slash effect under the Side Attack Transform game object on the Player. And since they are underneath a child of the player, whenever your player flips, the slash effect should flip too.
    That brings me to my theory of what the issue is:
    I think your side attack is calling SlashEffectAtAngle() instead of Instantiate.
    Check that your code in PlayerController.cs is as follows:

    void Attack()
        {
            timeSinceAttck += Time.deltaTime;
            if(attack && timeSinceAttck >= timeBetweenAttack)
            {
                timeSinceAttck = 0;
                anim.SetTrigger("Attacking");
    
                if (yAxis == 0 || yAxis < 0 && Grounded())
                {
                    int _recoilLeftOrRight = pState.lookingRight ? 1 : -1;
    
                    Hit(SideAttackTransform, SideAttackArea, ref pState.recoilingX, Vector2.right * _recoilLeftOrRight, recoilXSpeed);
                    Instantiate(slashEffect, SideAttackTransform);
                }
                else if (yAxis > 0)
                {
                    Hit(UpAttackTransform, UpAttackArea, ref pState.recoilingY, Vector2.up, recoilYSpeed);
                    SlashEffectAtAngle(slashEffect, 80, UpAttackTransform);
                }
                else if (yAxis < 0 && !Grounded())
                {
                    Hit(DownAttackTransform, DownAttackArea, ref pState.recoilingY, Vector2.down, recoilYSpeed);
                    SlashEffectAtAngle(slashEffect, -90, DownAttackTransform);
                }
            }
        }

    If this doesn't work, I'll need some screenshots or a video of the inspector of both PlayerController.cs in the scene, or the attack transforms + Slash Effect clones while attacking.

    Question 2: Zombie not recoiling.

    This was an issue that occurred to me as well. After testing now. I can tell you that the recoil should be working. If you crank the enemy speed down to 1 or 0, you can see that they are still being recoiled, just to a lesser extent than they had been before setting interpolate. While this is an additional issue due to interpolate, I'd say we can fix that by changing the code.

    public virtual void EnemyHit(float _damageDone, Vector2 _hitDirection, float _hitForce)
        {
            health -= _damageDone;
            if (!isRecoiling)
            {
                rb.velocity = _hitForce * recoilFactor * _hitDirection;
                isRecoiling = true;
            }
        }

    The isRecoiling bool was never set to true in our code, thus making RecoilLength a useless variable, but doing this will prevent your enemy from moving while being recoiled, which should cancel out the interpolate issue in general.

    Question 3: Spellcast after heal

    This is a common issue that others have experienced and in our bugfixes in Part 6. Check this to see if it helps (Second last comment):

    [Part 5] My SceneFader cannot function

    Alberto Fogli
    Participant

    Hi everyone,

    When i try to save the “bench” coordinates and die to see if i respawn back at the correct point, it load for a second at the correct position, but then i get teleported back at starting point and an error appears

    NullReferenceException: Object reference not set to an instance of an object
    UIManager+<DeactivateDeathScreen>d__8.MoveNext () (at Assets/Scripts/UIManager.cs:45)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress)

    Here is the code:

    Bench code:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.SceneManagement;
    
    public class SavePoint : MonoBehaviour
    {
        [SerializeField]public bool interacted;
    
        private void OnTriggerStay2D(Collider2D collision)
        {
            if(collision.CompareTag("Player") && Input.GetButtonDown("Interact"))
            {
                interacted = true;
    
                SaveData.Instance.stoneSceneName = SceneManager.GetActiveScene().name;
                SaveData.Instance.stonePos = new Vector2(gameObject.transform.position.x, gameObject.transform.position.y);
                SaveData.Instance.SaveStone();
            }
        }
    }
    

    Save data code:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using System.IO;
    using UnityEngine.SceneManagement;
    
    [System.Serializable]
    
    public struct SaveData  
    {
        public static SaveData Instance;
    
        //stone data
        public string stoneSceneName;
        public Vector2 stonePos;
    
        //player data
        public int playerHealth;
        public Vector2 playerPos;
        public string lastScene;
    
        public void Initialize()
        {
            if(!File.Exists(Application.persistentDataPath + "/save.stone.data"))
            {
                BinaryWriter writer = new BinaryWriter(File.Create(Application.persistentDataPath + "/save.stone.data"));
            }
        }
    
        public void SaveStone()
        {
            using(BinaryWriter writer = new BinaryWriter(File.OpenWrite(Application.persistentDataPath + "/save.stone.data")))
            {
                writer.Write(stoneSceneName);
                writer.Write(stonePos.x);
                writer.Write(stonePos.y);
            }
        }
    
        public void LoadStone()
        {
            string savePath = Application.persistentDataPath + "/save.stone.data";
            if (File.Exists(savePath) && new FileInfo(savePath).Length > 0)
            {
                using(BinaryReader reader = new BinaryReader(File.OpenRead(Application.persistentDataPath + "/save.stone.data")))
                {
                    stoneSceneName = reader.ReadString();
                    stonePos.x = reader.ReadSingle();
                    stonePos.y = reader.ReadSingle();
                }
            }
        }
    }

    Game manager code:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.SceneManagement;
    
    public class GameManager : MonoBehaviour
    {
        public string transitionedFromScene;   
        public static GameManager Instance { get; private set; }
    
        public Vector2 respawnPoint;
        [SerializeField] SavePoint stone;
        private void Awake()
        {
            SaveData.Instance.Initialize();
            if(Instance != null && Instance != this)
            {
                Destroy(gameObject);
            }
            else
            {
                Instance = this;
            }
    
            DontDestroyOnLoad(gameObject);
    
            stone = FindObjectOfType<SavePoint>();
        }
    
        public void RespawnPlayer()
        {
            SaveData.Instance.LoadStone();
    
            if(SaveData.Instance.stoneSceneName != null)
            {
                SceneManager.LoadScene(SaveData.Instance.stoneSceneName);
            }
    
            Debug.Log(SaveData.Instance.stonePos);
    
            if(SaveData.Instance.stonePos.x != 0 && SaveData.Instance.stonePos.y != 0)
            {
                respawnPoint.y = SaveData.Instance.stonePos.y + 1.358f;
                respawnPoint.x = SaveData.Instance.stonePos.x;
            }
            else
            {
                respawnPoint = new Vector2(-3f, -2.58f);
            }
    
            PlayerMovement.Instance.transform.position = respawnPoint;
            StartCoroutine(UIManager.Instance.DeactivateDeathScreen());
            PlayerLife.pl.Respawn();
    
        }
    }
    

    UIManager code:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;
    
    public class UIManager : MonoBehaviour
    {
        [SerializeField]Slider slider;
        [SerializeField]PlayerLife player;
        public static UIManager Instance;
        [SerializeField] GameObject deathScreen;
        public GameObject inventory;
        public SceneFader sceneFader;
    
        private void Awake()
        {
            if(Instance != null && Instance != this)
            {
                Destroy(gameObject);
            }
            else
            {
                Instance = this;
            }
            DontDestroyOnLoad(gameObject);
            
            sceneFader = GetComponentInChildren<SceneFader>();
        }
    
        public IEnumerator ActivateDeathScreen()
        {
            yield return new WaitForSeconds(0.8f);
            StartCoroutine(sceneFader.Fade(SceneFader.FadeDirection.In));
    
            yield return new WaitForSeconds(0.8f);
            deathScreen.SetActive(true);
        }
    
        public IEnumerator DeactivateDeathScreen()
        {
            yield return new WaitForSeconds(0.2f);
            deathScreen.SetActive(false);
    
            StartCoroutine(sceneFader.Fade(SceneFader.FadeDirection.Out));
            slider.value = player.maxHealth;
        }
    
        // Start is called before the first frame update
        void Start()
        {
            
            slider.maxValue = player.maxHealth;
            slider.value = player.maxHealth;
        }
    
        public void UpdateUIHealtbar(int currentHealth)
        {
            slider.value = currentHealth;
        }
    }
    

    Thanks in advance to everyone

    #13692

    In reply to: [Request] New Game

    Joseph Tang
    Moderator

    I will have to get back to you on the Reset data button.

    As for reloading the game to only the Bench position I can help. I’m assuming this means pausing the game then exiting to main menu and quitting, rather than closing the game mid playthrough. Also, I’m assuming you have completed the scripts until Part 9.

    In your SaveData.cs, try out this:

        public void SavePlayerData()
        {
            using (BinaryWriter writer = new BinaryWriter(File.OpenWrite(Application.persistentDataPath + "/save.player.data")))
            {
                playerHealth = PlayerController.Instance.Health;
                writer.Write(playerHealth);
                playerHeartShards = PlayerController.Instance.heartShards;
                writer.Write(playerHeartShards);
    
                playerMana = PlayerController.Instance.Mana;
                writer.Write(playerMana);
                playerHalfMana = PlayerController.Instance.halfMana;
                writer.Write(playerHalfMana);
                playerManaOrbs = PlayerController.Instance.manaOrbs;
                writer.Write(playerManaOrbs);
                playerOrbShard = PlayerController.Instance.orbShard;
                writer.Write(playerOrbShard);
                playerOrb0fill = PlayerController.Instance.manaOrbsHandler.orbFills[0].fillAmount;
                writer.Write(playerOrb0fill);
                playerOrb1fill = PlayerController.Instance.manaOrbsHandler.orbFills[1].fillAmount;
                writer.Write(playerOrb1fill);
                playerOrb2fill = PlayerController.Instance.manaOrbsHandler.orbFills[2].fillAmount;
                writer.Write(playerOrb2fill);
    
                playerUnlockedWallJump = PlayerController.Instance.unlockedWallJump;
                writer.Write(playerUnlockedWallJump);
                playerUnlockedDash = PlayerController.Instance.unlockedDash;
                writer.Write(playerUnlockedDash);
                playerUnlockedVarJump = PlayerController.Instance.unlockedVarJump;
                writer.Write(playerUnlockedVarJump);
    
                playerUnlockedSideCast = PlayerController.Instance.unlockedSideCast;
                writer.Write(playerUnlockedSideCast);
                playerUnlockedUpCast = PlayerController.Instance.unlockedUpCast;
                writer.Write(playerUnlockedUpCast);
                playerUnlockedDownCast = PlayerController.Instance.unlockedDownCast;
                writer.Write(playerUnlockedDownCast);
    
                playerPosition = PlayerController.Instance.transform.position;
                writer.Write(playerPosition.x);
                writer.Write(playerPosition.y);
    
                lastScene = SceneManager.GetActiveScene().name;
                writer.Write(lastScene);
            }
        }
    
        public void LoadPlayerData()
        {
            if (File.Exists(Application.persistentDataPath + "/save.player.data"))
            {
                using (BinaryReader reader = new BinaryReader(File.OpenRead(Application.persistentDataPath + "/save.player.data")))
                {
                    playerHealth = reader.ReadInt32();
                    playerHeartShards = reader.ReadInt32();
    
                    playerMana = reader.ReadSingle();
                    playerHalfMana = reader.ReadBoolean();
                    playerManaOrbs = reader.ReadInt32();
                    playerOrbShard = reader.ReadInt32();
                    playerOrb0fill = reader.ReadSingle();
                    playerOrb1fill = reader.ReadSingle();
                    playerOrb2fill = reader.ReadSingle();
    
                    playerUnlockedWallJump = reader.ReadBoolean();
                    playerUnlockedDash = reader.ReadBoolean();
                    playerUnlockedVarJump = reader.ReadBoolean();
    
                    playerUnlockedSideCast = reader.ReadBoolean();
                    playerUnlockedUpCast = reader.ReadBoolean();
                    playerUnlockedDownCast = reader.ReadBoolean();
    
                    playerPosition.x = reader.ReadSingle();
                    playerPosition.y = reader.ReadSingle();
                    lastScene = reader.ReadString();
    
                    benchPos.x = reader.ReadSingle();
                    benchPos.y = reader.ReadSingle();
                    benchSceneName = reader.ReadString();
    
                    SceneManager.LoadScene(lastScene);
                    PlayerController.Instance.transform.position = playerPosition;
    
                    SceneManager.LoadScene(benchSceneName);
                    PlayerController.Instance.transform.position = benchPos;
                    PlayerController.Instance.halfMana = playerHalfMana;
                    PlayerController.Instance.Health = playerHealth;
                    PlayerController.Instance.heartShards = playerHeartShards;
                    PlayerController.Instance.Mana = playerMana;
                    PlayerController.Instance.manaOrbs = playerManaOrbs;
                    PlayerController.Instance.orbShard = playerOrbShard;
                    PlayerController.Instance.manaOrbsHandler.orbFills[0].fillAmount = playerOrb0fill;
                    PlayerController.Instance.manaOrbsHandler.orbFills[1].fillAmount = playerOrb1fill;
                    PlayerController.Instance.manaOrbsHandler.orbFills[2].fillAmount = playerOrb2fill;
    
                    PlayerController.Instance.unlockedWallJump = playerUnlockedWallJump;
                    PlayerController.Instance.unlockedDash = playerUnlockedDash;
                    PlayerController.Instance.unlockedVarJump = playerUnlockedVarJump;
    
                    PlayerController.Instance.unlockedSideCast = playerUnlockedSideCast;
                    PlayerController.Instance.unlockedUpCast = playerUnlockedUpCast;
                    PlayerController.Instance.unlockedDownCast = playerUnlockedDownCast;
                }
            }

    Under SavePlayerData() you can comment out/remove the playerPosition & lastScene codes as you won’t need it for this purpose. While in your LoadPlayerDate() replace playerPosition codes with benchPos & lastScene codes to benchSceneName. Doing this will allow your player to load into the game with the correct health, mana and etc, while loading at the Bench position and scene you last saved in.

    However, you will also need a way to save the data as the only codes saving it now is the unlocks, the shade and death.

    In your SceneFader, try this:

    public void CallFadeAndLoadScene(string _sceneToLoad)
        {
            SaveData.Instance.SavePlayerData();
            StartCoroutine(FadeAndLoadScene(FadeDirection.In, _sceneToLoad));
        }

    Under CallFadeAndLoadScene(), add SaveData.Instance.SavePlayerData(); before starting the coroutine. This allows your player’s data to be saved upon entering any scene and main menu exit button.

    However, I do not advise these method of loading the game. If the player were able to exit and re-enter the game by going back to the bench, this allows what is essentially a fast travel or get out of trouble mechanic for the player by just simply quitting the game. Or in another case it could accidentally reset the player’s progress.

    If the code does not work, feel free to tell me as this is simply theory and I have not yet tested the code.

    #13683
    Terence
    Keymaster

    Try moving the sceneFader up to Awake():

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class UIManager : MonoBehaviour
    {
        public static UIManager Instance;
    
        private void Awake()
        {
            if (Instance != null && Instance != this)
            {
                Destroy(gameObject);
            }
            else
            {
                Instance = this;
            }
            DontDestroyOnLoad(gameObject);
            sceneFader = GetComponentInChildren<SceneFader>();
        }
    
        public SceneFader sceneFader;
    
        private void Start()
        {
            sceneFader = GetComponentInChildren<SceneFader>();
        }
    }
    #13678
    Terence
    Keymaster

    Can you add this above line 25 of your SceneTransition as well? I’m checking if either UIManager.Instance or UIManager.Instance.sceneFader is the null value.

    print(UIManager.Instance);
    print(UIManager.Instance.sceneFader);

    Show me the output on the Console after that.

    #13676
    Elvin Sim
    Participant
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class UIManager : MonoBehaviour
    {
        public static UIManager Instance;
    
        private void Awake()
        {
            if (Instance != null && Instance != this)
            {
                Destroy(gameObject);
            }
            else
            {
                Instance = this;
            }
            DontDestroyOnLoad(gameObject);
    
        }
    
        public SceneFader sceneFader;
    
        private void Start()
        {
            sceneFader = GetComponentInChildren<SceneFader>();
        }
    }
    #13669
    Anuk Thotawatta
    Participant

    I tried and that doesn’t seem to be the problem. when I move death screen above scene fader and play the scene fader sits on top of the death screen and I cant click the button. the respawn button works if I die in another scene. I cant interact with it only if I die in the scene with the bench in it.

    #13666
    Terence
    Keymaster

    Hi Ethan, you need to change the SceneFader script’s Start() function to Awake():

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.UI;
    using UnityEngine.SceneManagement;
    
    public class SceneFader : MonoBehaviour
    {
        [SerializeField] private float fadeTime;
    
        private Image fadeOutUIImage;
    
        public enum FadeDirection
        {
            In, 
            Out
        }
    
        // Start is called before the first frame update
        void Start() Awake()
        {
            fadeOutUIImage = GetComponent<Image>();
        }
    
        ...
    
    Elvin Sim
    Participant
    #13655
    Terence
    Keymaster

    the names of the scenes are correct and are in correct order

    Move the Death Screen above the Scene Fader and see if it fixes the Respawn button not responding.

Viewing 15 results - 46 through 60 (of 77 total)

Advertisement below: