okay but how do i check that ?

  • xyz replied to this.

    Elroy Where did you get those action names from in the first place?

    You can check/map input actions in Project > Project Settings > Input Map

    For a quick start you can try using default actions for cursor keys:

    var input_dir = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")

    i got them from a video on youtube that changes the movement from the arrow keys to the azerty keys

    oke i tried the arrow keys and that does work


    these are the inputs i use

    • xyz replied to this.

      Elroy Looks like you don't have any actual keys mapped to those actions. Click the plus icon for each and assign a key.

      ooooh okay thank you

      thank you its working now, i feel stupid xp but thanks, only thing is when i go crouch and let it go , its like i get puched in the air a little and then back to the ground

      • xyz replied to this.

        Elroy its like i get puched in the air a little and then back to the ground

        That sounds about right according to code you posted.

        how can i change that ?

        • xyz replied to this.

          Elroy how can i change that ?

          This questions is widely unspecific. So all I can answer to that is: by changing the code 🙂

          iv got a other problem now with some code

          func _unhandled_input(event):
          	_mouse_input = event is InputEventMouseMotion and Input.get_mouse_mode()
          Input.MOUSE_MODE_CAPTURED
          	if _mouse_input:
          		_rotation_input = event.relative.x
          		_tilt_input = event.relative.y

          This is the error i get :

          Line 25:Unexpected "Identifier" in class body.
          Line 26:Unexpected "Indent" in class body.
          Line 27:Unexpected "Indent" in class body.
          Line 28:Unexpected "Identifier" in class body.
          Line 30:Expected end of file.

            Elroy Input.MOUSE_MODE_CAPTURED

            Why is that line there? It's not indented, which is causing the error messages.

            It also has no purpose.

            i was watching a video to make mouse movement , idk how to fix it xp

            These two lines:

            _mouse_input = event is InputEventMouseMotion and Input.get_mouse_mode()
            Input.MOUSE_MODE_CAPTURED

            should be this single line:

            _mouse_input = event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED

            thank you but now i can just look down till the camera is fully rotated how do i fix that the camera has a up and down limmit ?

            • xyz replied to this.

              Elroy You haven't posted any camera rotation code.

              func _ready():
              	original_scale = scale
              	Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
              
              func _input(event):
              	if event is InputEventMouseMotion:
              		rotate_y(deg_to_rad(-event.relative.x * mouse_sens))
              		head.rotate_x(deg_to_rad(-event.relative.y * mouse_sens))

              this is what i have

              • xyz replied to this.

                Elroy Well, just clamp() x rotation into certain range.