hello, my name is SeanKelly Galler. I'm a Student at Darfield High school. currently, I'm having trouble making my Victory message screen to appear. First off this image right here is my victory message I wanted to show once the player reached the finish line. however when the player reach the finish line the victory screen doesn't show up... if you want to help me here's the info i can give it to you! if you want to help me feel free to talk to me any help would be a pleasure! and also free to ask me if you need more info about my game!
You simply need to debug. Try putting a breakpoint in the OnTriggerEnter2D to see if you ever enter there or add a "Debug.Log" to output something to the control. Without that you have no idea if the logic in the callback is wrong or has a problem or if the trigger isn't working. If the trigger isn't working then it'll be because the two colliders don't overlap or they are not set to collide with each other. You may find the triggers is working and the logic in there does but the problem is with the victory screen. It's best to figure these steps out first before asking for help. If you've already done this then it's best to state what you've tried already which'll make helping you quicker. So to start, check to see if the trigger callback happens. Hope that helps.
um is it possible to just give my project to you to look at the problem? since it will be much easier to quicker to find a problem? we've done this before can we do it again? plz?
So I figured out how to reproduce it but it does hit the trigger block in "Game Lv3" and the trigger callback happens which I guess you know because "victorytext" is output to the console (btw: you should really mention this as it enables quicker help for you): Code (CSharp): public void Victorygame() { Destroy(gameObject); GameLevelManager.reStartTheGame(); Animator victoryAnimator = Victorytext.GetComponent<Animator>(); victoryAnimator.SetTrigger("victory"); Debug.Log("victorytext"); } When you do this you get an error to the console because the GameObject the animator/text are on are deactivated so you don't see your text. As a hack I simply activate the GameObject but you'll need to figure out when that should be done and then maybe deactivated: Code (CSharp): public void Victorygame() { Destroy(gameObject); GameLevelManager.reStartTheGame(); Animator victoryAnimator = Victorytext.GetComponent<Animator>(); Victorytext.gameObject.SetActive(true); // <- Make sure the thing is active. victoryAnimator.SetTrigger("victory"); Debug.Log("victorytext"); } Hope this helps.