BaseInputModule - Process() not being called

I have a prefab instance TestUI. I attached a class TestBaseInput (inherits from BaseInputModule) along with an event system. Everything was working fine. Process() was being called on TestBaseInput. Then it broke…

But this is the weird part, if I duplicate the prefab instance, and de-activate or delete the first instance, Process() will fire. WTF?!

Literally nothing has changed between the first prefab instance and the second. UNITY GODS, PLEASE HELP!

This is a wild guess but It sounds like there is a saved referance to the deleted object being held as a null referance in a list somewhere in the object dispatching the Process event/method to the subclasses, maybe that referance needs to be reset. Try and enable debugging on the inspector and check out the eventsystem to see if there is any referances that turns into missing/null when you deleted the first object.

1 Like

Ok, you pointed me in exactly the right direction! Looks like Current Input Module is not being set correctly to my derived class, but I don’t know why or which script to look at to start to debug that.

Wait nevermind, this is getting weirder, Current Input Module is getting set sometimes, but Process() is still not getting called.

If I duplicate and delete the original prefab instance, Process() is getting called, but if I save the scene and restart Unity, Process() won’t be called again. WTF?!

Don’t know if you figured this out or now but the reason Process() isn’t called sometimes, in Editor, is because the Game Window/Tab is not in focus. You do that simply by clicking in the window.

Hope this helps!

4 Likes

oh man, that resolves that mystery, how annoying! but thank you for telling me

1 Like

i just clicked the game window ,my problem is resoved. thks

2 Likes