- Home /
New Input System : Changing control scheme sets an input to zero
Hello there. I'm making a top-down factory game and I want both gamepad and keyboard/mouse to be compatible. I have a building placement system that places buildings according to either :
Mouse position for keyboard and mouse
The right stick for gamepads
As you can tell, both coordinates are much, much different. So, I've made two actions: LookMouse and Look (for Gamepad). Each are bound to only one control scheme.
In my input handling script, my both functions :
LookMouse : I update the building's position by using a raycast
Look : I update a delta which displaces the building in Update()
The thing is, when I switch schemes, LookMouse is called with input value (0,0), causing my building to go to the bottom left!
Comment