I’m currently working on an inventory menu for my game where you use the directional keys to move a cursor and select objects (like in pretty much all of the Resident Evil games, for example). In particular I’m making a grid/“tetris” inventory system. In order to determine whether a given grid slot is available (and therefore selectable), I basically gave both my slot objects and my item objects rigidbodies and box colliders, and check for OnTriggerStay. For hours I couldn’t figure out why it wasn’t working until I realized that I pause the game while the inventory menu is open by setting Time.timeScale to 0, and collisions don’t calculate while the time is 0.
I’ve done some internet research and I keep seeing people sing the praises of using timeScale to pause your game, only to ignore people pointing out the physics problem, which in my view is a pretty serious oversight unless there’s some obvious better way to do this than what I’ve come up with. Is there a way to enable particular colliders while timeScale is 0, or is timeScale not actually a very good way to handle pausing the game, contrary to what I’ve seen so many people claim? Or, alternatively, am I overlooking a better method for checking for overlap between two UI objects that doesn’t involve using Unity’s physics system?
Thanks in advance for any assistance. I don’t think my question should require sharing any of my code but if there’s something you need to see to answer the question please let me know!