- Home /
with a joystick impossible to have horizontal=1 and vertical=1 at the same time
I have an XBOX 360 controller and when I put the joystick in the upper right corner I expect to have horizontal=1 and vertical=1 but it is not the case.
I'm working on a 2D scrolling game and more the stick is up and less the ship speed is important (altitude of the ship is based on vertical (1=top of screen) and speed is based on horizontal (1=full speed) => I'm not able to go on the top of the screen at full speed...) Do you know if it is possible to configure the input to have this situation or do I have to manage this by script ?
If it must be by script : is there already some examples to help me ?
thanks in advance for your answers
Answer by SgtCrapgame · Jan 08, 2012 at 07:07 PM
Well I applied a multiplier to horizontal and vertical (here 2.5F) and then limit them to [-1..1] and all is working well : when I put the joystick in the upper right corner I have horizontal=1 and vertical=1
Yeah that is the best way really, because most joysticks/gamepads have a physical barrier around the stick that is circle, so it would be mechanically impossible to get 1,1.