Issues with new Input system
Author: Chance King
This week I've been trying to tackle an issue we had with our UI pause menu. There was an issue with using the new input system where having a unique player input component on the UI canvas for each scene would throw null references whenever loading into a new scene. This would in turn cause the input in the newly loaded scene to stop working, making it impossible to pull up the pause menu.
While I never was able to track down the root of the issue, being that the error message was really vague and didn't lead me to any point in code, I did end up finding a workaround solution. That solution came in part by using the player input component that the cheat handler runs off. Since it was on an object that is set to do not destroy, having the component removed and reloaded every scene was no longer an issue. I just added a new OnEscape function to the cheat handler and had it sent out when it was being pressed for the UI to be able to read. And just like that the UI was back on track and working in every scene again. And with the upside of not having to destroy a player input component every time the player changes scenes, while a small cost it is still a cost to be happy with cutting out.
Disavowed
Status | In development |
Authors | King Studio, Devon0033, Mike_Sroka, Michael-W-Smith7 |
Genre | Adventure |
Tags | 2D, Action-Adventure, Metroidvania, Unity |
More posts
- Steam Launch!!!Dec 17, 2022
- Coming to a closeDec 16, 2022
- Project OverviewDec 14, 2022
- Steam StuffDec 13, 2022
- Achievement GetDec 11, 2022
- Controls Remapping AgainDec 10, 2022
- Steam funDec 09, 2022
- Boss Music ImplementationDec 09, 2022
- SteamWorksDec 02, 2022
- Callback Issue with Controller SupportDec 02, 2022
Leave a comment
Log in with itch.io to leave a comment.