Looks like you're not logged in

Login or Register to continue

Lesson Q&A

Use this space for questions related to what you're learning. For any other type of support (website, learning platform, payments, etc...) please get in touch using the contact form.

  • The bullets only shoots to the rightJelielTesting in the weapon scene it shots to direction of the node, but in the player scene not. 2 0 Dec. 20, 2024
  • Does moving the arms with the joypad feel jittery to anyone else?icky-ibisWhen moving using a joypad, it seems the motion is jittery compared to the mouse? The input mapping as it is setup in my project settings are as below: ```gdscript "aim_left" : Joypad Axis 2 - (Right Stick Left, Joystick 1 Left) - All Devices "aim_right" : Joypad Axis 2 + (Right Stick Right, Joystick 1 Right) - All Devices "aim_up" : Joypad Axis 3 - (Right Stick Up, Joystick 1 Up) - All Devices "aim_down" : Joypad Axis 3 + (Right Stick Down, Joystick 1 Down) - All Devices ``` 1 0 Dec. 20, 2024
  • I don't see any difference in logic between your suggestion and my code...CptnNuggetsand yes, mine doesn't work ! The input with the gamepad works fine, not with the mouse. BUT... before implementing the gamepad, the mouse detection worked just fine (it's only the rotation that is the issue, not shooting). I know I am not using the direction_to() method, but it still works... outside the if statement... I tried with your code (no changes were needed considering my conventions)... and yours works ! I am baffled as I really can't see what I did wrong -_-' ```gdscript var input_is_joypad := false func _unhandled_input(event: InputEvent) -> void: if event is InputEventJoypadMotion or InputEventJoypadButton: input_is_joypad = true else: input_is_joypad = false func _process(delta: float) -> void: var aim_direction := Vector2.ZERO if input_is_joypad: aim_direction = Input.get_vector("aim_left", "aim_right", "aim_up", "aim_down") else: aim_direction = get_global_mouse_position() - global_position rotation = aim_direction.angle() ``` 2 0 Dec. 17, 2024
Site is in BETA!found a bug?