Game Development Community

Input not reset between scenes

by Pablo Alonso · in Torque X 2D · 07/20/2009 (8:49 pm) · 2 replies

I have two scenes, on the first scene when 'A' is pressed I unload the first one and then load the second scene, I call

ProcessList.Instance.AddTickCallback(Owner, this);

On the second scene and then I bind 'A' again, but when I check it it's always true, it never resets. I tried calling Reset on InputMap but it doesn't help.

Any idea why it might get stuck on true? On the first scene I added

ProcessList.Instance.RemoveObject(Owner);

to _OnUnregister, but doesn't seem to be called when the scene is unloaded.

#1
07/21/2009 (10:42 am)
Hey Pablo,
Sounds like Scott Zarnke's fix for unmapping and mapping controls might help here. Resource is here: How to unbind inputmapped controls.
If that doesn't work, try the code off this post when unloading and loading a scene: Next level

Brian
#2
07/21/2009 (1:40 pm)
What I ended up doing is setup the input map at the very beginning of the game and then when I load a new scene I just change the ControlObject to the object I need to listen to it, seems to work pretty good so far.