when I press the right mouse button to aim the player aim up,sometimes down but he should aim in the center first and when I move the mouse up down, he follow the movement.I think the problem is in the script. does anyone can tell me what should add in this script!.
While you’re designing you should enable visibility of the mouse cursor in Properties > Render.
Since your mouse is unlikely to be centered when you first R-click, the arm aims some random direction.
If you put this in your script:
if MouseMove.positive:
bge.render.setMousePosition(int(CenterX), int(CenterY))
just prior to the activation of the Aim sensor it will work as long as you have moved the mouse since starting the game. To avoid that potential glitch you could center the mouse at startup with a script attached to a non pulsing Always sensor.