Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

For a game I am making I would like the user to be able to change the controls (in game NOT through the clunky launch window (wich i disabled)) I have the system working but don't know how to change the controls for FPS controller. I am okay with writing my own version of the FPSInputController but I don't really know how to do that (the good way (using the CharcaterMotor)) I looked at the original FPSInputController script but that used axes (from the "conventianal" input settings in unity) and I don't really know how to do that with:

if (Input.GetKey(controls.forward))
share|improve this question

1 Answer 1

I would create a separate InputMapping class that simply correlates different Unity input names with my own input names. Then other parts of the game (eg. a keyboard settings popup) can change these mappings (eg. what InputMapping.Forward maps to). Now change the FPS movement script to use the settings from InputMapping instead of referring to Unity inputs directly.

share|improve this answer
    
Yeah, I was trying to do this but the unity FPS movement script uses a the horizontal and vertical input 'axes' to define a Vector3 directionVector variable and I for the life of me don't know how to do that with just Input.GetKey or something like that –  koekeritis Mar 1 at 20:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.