Keyboard, Mouse and Joystick Input -- Godot 3 Tutorial Series

Поделиться
HTML-код
  • Опубликовано: 1 фев 2025

Комментарии • 91

  • @gamefromscratch
    @gamefromscratch  6 лет назад +4

    GFS Series Table Of Contents
    www.gamefromscratch.com/page/Godot-3-Tutorial-Series-Index.aspx
    Sample Code From This Example:
    www.gamefromscratch.com/page/Godot-3-Tutorial-Keyboard-Mouse-and-Joystick-Input.aspx
    Complete Game Tutorial:
    devga.me/tutorials/godot2d/
    GFS Patreon -- Check out the WIP book!
    www.patreon.com/gamefromscratch

  • @Yee.Naaldlooshii
    @Yee.Naaldlooshii 5 лет назад +3

    You are single-handedly teaching me Godot good sir. You're the best Godot tutor on RUclips. Super underrated. Thank you.

  • @SystemShockRacing
    @SystemShockRacing 2 года назад +1

    It's been 4 years, but still a great tutorial, thanks so much for making it. Hopefully a Godot 4 series is coming once it hits stable? Would love to see this updated with all the new stuff

  • @fire7side
    @fire7side 5 лет назад +2

    Fantastic series. Great way to get up and running with Godot. I'm switching over from Unity which has become a nightmare with the constant upgrades and error after error. Plus it was too big for a hobbyist like myself. Godot seems just right.

  • @GurniHallek
    @GurniHallek 6 лет назад +9

    26:44 For some reason that "JOY AXIS" variable makes me chuckle.

  • @uniqueobject9218
    @uniqueobject9218 6 лет назад +3

    Thank You,I can't wait to see the mobile touch screen , especially a kind of analog touch , and so wen the player touches the screen and the avatar moves to that specific place were the player tapped

  • @willnationsdev
    @willnationsdev 6 лет назад +8

    You might have to make an addendum to this down the road for 3.1 now that actions incorporate a strength value as well, to account for "axis" actions. Overall nice tutorial though. I'm definitely flagging this one to watch in more detail when I need it.

    • @gamefromscratch
      @gamefromscratch  6 лет назад +13

      Yeah, this is the underlying challenge of documenting any game engine. It really REALLY sucks that Google removed annotations, they were really good for addressing these kinds of changes. At the end of the day though I was light on my InputMap portion because I knew the changes were coming.

  • @jonathancamarena3117
    @jonathancamarena3117 6 лет назад +2

    Man so many great creators making great godot tutorials! keep it up :)

  • @fluhere
    @fluhere 4 года назад

    Aw men, thanks soo much, all the ttuturials i found where to hard and this is one is good for a begginer for me! I love your videos, you deserve my like-sub! as you can see im more of a python coder but im starting to get used to this ;)

  • @CorporaMedicina
    @CorporaMedicina 3 года назад

    ooo...the input map is sweet...thank you.

  • @AlexanderWernerJr
    @AlexanderWernerJr 2 года назад

    Great tips, thank you for this very essential tutorial!

  • @Stan10785
    @Stan10785 6 лет назад

    Great Tutorial - looking forward to the book also

  • @gedariaofficial8818
    @gedariaofficial8818 6 лет назад +1

    very nice videos, Thanks a lot man, i am very interested in this engine and thanks to you i can better understand it,
    Thanks once more!

  • @terramoth
    @terramoth 5 лет назад

    Love your tutorials, just what I was looking for!!!!

  • @sk8erclone25
    @sk8erclone25 5 лет назад +1

    This was extremely helpful. Thank you so much

  • @danielketcheson1965
    @danielketcheson1965 Год назад

    To bring up the documentation search bar at 34:07, Ctrl+F.
    Same as any web page using Windows.

  • @maxmustermann9630
    @maxmustermann9630 5 лет назад

    Perfect tutorial!! Informative and well paced. thumb up!
    and you fucking gave us the code for those of us too lazy to write the code. Heaven! Thank you very much

  • @albrechtshnoodle1128
    @albrechtshnoodle1128 4 года назад +1

    When working with joysticks/gamepads, It is much better to have a class-wide variable for the device id which can be assigned in the joy_con_changed() function. This way the last controller plugged in is the one controlling the game. Otherwise, the controller you want to use might not work.

  • @avtem
    @avtem 2 года назад

    As you said in your previous video - there is an option to attach a script without comments. You still create one with comments and remove them manually)

  • @WerIstWieJesus
    @WerIstWieJesus 5 лет назад

    Thank you for this very useful tutorial!

  • @DipanjanPatra
    @DipanjanPatra 6 лет назад +12

    Is not using += xAxis same as using -= abs(xAxis) and += abs(xAxis) with 2 separate if conditions? That part seemed redundant. Otherwise great video 😊

    • @connor3010
      @connor3010 5 лет назад +3

      Yeah came here to say this. There is no need to remove the signing of the axis that it comes with only to add it back with an if statement. abs(xAxis) is only necessary for calculating the deadzone

    • @Ciph3rzer0
      @Ciph3rzer0 5 лет назад +4

      Lot of game tutorials online are by no means good or even moderate programmers lol. This is one of those things that makes me cringe. Like people typing "if bool == true"

    • @SleepingBeautyexerp1
      @SleepingBeautyexerp1 4 года назад

      noob here...so, how should it look like?

  • @digitalman2112
    @digitalman2112 6 лет назад

    Excellent series. Thank you!

  • @llYuki0okami
    @llYuki0okami 4 года назад +1

    so we should use _input(event) or _process(delta) to move ur player? or this no matter for cpu?

  • @chcamp
    @chcamp 6 лет назад

    heeyy thanks!! this course is super!!! thanks for dedicated ur time in show how make games in Godot (100% open Source!!) :)

  • @neelsb7889
    @neelsb7889 3 года назад +1

    Thanks for the helpful tutorial. Do you know if there is a way to use 2 mice (or a touchpad and a mouse) to control 2 distinct cursors, objects/characters in a Godot project to allow 2 multiplayer inputs at once? I have found the ProtoInput project, which uses C and C++ libraries to enable such functionality for many existing games, but what I would like to do is to build it into my game, where 2 players compete to be the first to find a specified object, hidden amongst many other objects... Obviously just connecting a mouse to a laptop and expecting to use the touchpad for one player and the mouse for the other would not work, due to the limited (and primitive) nature of how Windows handles input devices such as a keyboard and mouse. Surely there must be a way to make this work inside the game though!?

    • @Visstnok
      @Visstnok 2 года назад

      I've been wanting this, too. But even in Godot 4 it seems not to be possible.

  • @sotsubreivaj
    @sotsubreivaj 4 года назад

    Great video, but... what if I don't wanted to teleport, but to have my character walk to the position a clicked, much as when I press the directional keys? I can't manage to work it out. And all solutions I found are for KinematicBody2D and I have an Area2D node for my character.

  • @hillarybanda589
    @hillarybanda589 5 лет назад +4

    can i have a tutorial of the same nature for 3d objects,links are welcome
    thank you

  • @hamzakh6913
    @hamzakh6913 6 лет назад +3

    can somebody explain that boolean named as "justwarped"
    why it is used down below in the if statement. i couldn't clearly understand his words. somebody explain it.

    • @VilasNil
      @VilasNil 6 лет назад +6

      If I understood correctly, he implemented it to use it later when using the left mouse button. He does so in order to not move the character while the mouse is being warped to the character's position, as the character moves relative to the mouse. If the justwarped variable wasn't there, when the mouse warps to the character, the character would move the same amount in the same direction

  • @jimmyslaughter6262
    @jimmyslaughter6262 2 года назад

    Oh my god this is so much faster than Python. I'm so glad I decided to switch.

  • @GabrielAnimations
    @GabrielAnimations 5 лет назад

    Thank you man!!!

  • @colly9888
    @colly9888 4 года назад

    You're my hero!

  • @christophersootoo9168
    @christophersootoo9168 5 лет назад

    This is great and all, but I feel like something was missing. I’m trying to use the analog stick to rotate a 2Dnode. I’ve looked everywhere and can’t find out how to do it. I can do it in C# easily, but for some reason gdscript just wont rotate it

  • @Amessenger.
    @Amessenger. 4 года назад +2

    There's an error that I can't fix it looks like this
    The method "is_joy_known" isn't declared in the current class.

  • @krittikus
    @krittikus 4 года назад

    This is awesome, it helped me a lot. I started with godot like 3 days ago.
    I just have one question: (to avoid mistakes, i copied and pasted from the example after several fails).
    Godot seems to not recognize my joistick (its a xbox 360 original). No matter what i do.
    Is it necesary to be a wired joystick? or wireless also work? ( im using wireless)

    • @gamefromscratch
      @gamefromscratch  4 года назад

      If it detects in the windows joystick control panel it should work just fine either way.

  • @briankel5229
    @briankel5229 3 года назад

    Is there a way to tell the code to register an input, such as a key on the keyboard, as a mouse click?

  • @HeyItsDoodler
    @HeyItsDoodler 4 года назад +1

    “Python and Godot are the only languages that have a Godot after a...” XD 12:06

  • @TheVirakahScale
    @TheVirakahScale 7 месяцев назад

    I'm I crazy for finding it difficult to get my player to rotate to the same angle as the joystick? I can't find anything anywhere on how to implement that.

  • @IronBrandon22
    @IronBrandon22 5 лет назад

    When printing, you can do [deviceid+1] to make it look like the first joy-con when the game still sees it as 0

  • @sixiangyang
    @sixiangyang 6 лет назад

    thanks ,very impressive.

  • @keithwinget526
    @keithwinget526 4 года назад

    I cannot, under any circumstances, get godot to work with _unhandled_input(event): even the naked function just trying to print something to see if its working at all, is not working at all. I literally have nothing in the scene but a KinematicBody2D with a sprite and CollisionSHape2D. There are no UI elements or anything else going on. It literally detects NO input. However, _input(event): is working just fine. How is this possible? What is somehow setting all events to "handled" by default? I am losing my freaking mind here.

  • @inkkles
    @inkkles 4 года назад

    why are you making the script in the sprite and not in the player?
    and why not use the move and slide funtion?

  • @Ian_Comics
    @Ian_Comics 4 года назад

    When I click the icon wants to move to the bottom right area or my mouse curser will move instead.

  • @hilfazer
    @hilfazer 6 лет назад

    Are You going to cover multiple Viewports or Anchors/Layouts in your GUI video?

  • @FelixxFelixx-tt7sf
    @FelixxFelixx-tt7sf 5 лет назад +3

    It is not working with my SwitchProController. How can I fix this?

    • @jimmyg8100
      @jimmyg8100 4 года назад

      Did you ever find a solution to this?

    • @FelixxFelixx-tt7sf
      @FelixxFelixx-tt7sf 4 года назад +1

      @@jimmyg8100 nope, but apparently Godot thinks that all buttons are being held constantly

    • @jimmyg8100
      @jimmyg8100 4 года назад +1

      @@FelixxFelixx-tt7sf But you got Godot to read your controller?

    • @FelixxFelixx-tt7sf
      @FelixxFelixx-tt7sf 4 года назад +1

      @@jimmyg8100 ya

    • @jimmyg8100
      @jimmyg8100 4 года назад

      How did you get it to read your Switch Pro Controller?

  • @jimmyg8100
    @jimmyg8100 4 года назад

    How do you set this up for a Bluetooth/wireless controller? I am using a PowerA Switch Wireless Switch controller and Godot does not recognize it.

  • @josephsnyder5713
    @josephsnyder5713 5 лет назад

    How would one go about making a controls function it its own engine so that the player(s) script can pull from the project settings auto-load? I saw it in somebodys video somewhere and cant find it again.

  • @giugix
    @giugix 2 года назад

    What if i want to use the stick on the Y

  • @arthurr3849
    @arthurr3849 6 лет назад

    Can you please make a tutorial series on Escoria Framework (Point and Click) - Godot 3.0?
    And btw, thank you for your awesome tutorials.

    • @gamefromscratch
      @gamefromscratch  6 лет назад

      You know, I actually looked at doing a video on this exact subject and at the time it was really broken. I'll check it out again and see if it's any better.

    • @arthurr3849
      @arthurr3849 6 лет назад

      Sorry for the late reply. But it would be really helpful if you make a tutorial series on that topic or maybe on Point and Click games in general.
      Thanks for the reply and take care.

  • @migopl
    @migopl 4 года назад

    bool is_joy_known (int device)
    String get_joy_name (int device)
    You want to pass deviceid to this functions for multiple controllers/joysticks connected to pc

  • @JimPAnimation
    @JimPAnimation 6 лет назад

    And what if you're making this to also work on a tablet? do you also need swipe commands? does Godot come with swipe commands? And do you leave all the code in (keyboard, joystick, dpad, AND swipe and then you're prepared for all devices??) i think you answer in the last 3 min...but you don't mention any swipe actions for tablet and i don't think any showed up in the pick list for the input options. ok, the last 30 seconds you mentioned mobile.. haha
    thank you

    • @gamefromscratch
      @gamefromscratch  6 лет назад +2

      Yeah, I will be covering mobile inputs in a later chapter.

  • @chickeninabox
    @chickeninabox 4 года назад

    I am scared that there are no semicolons and brackets.

  • @baileyburnsed4352
    @baileyburnsed4352 6 лет назад

    can you use strings as input
    for text adventures

    • @gamefromscratch
      @gamefromscratch  6 лет назад

      Yes, but you wouldn't do it this way. I will be doing a video shortly on UI in Godot, that will probably cover what you are interested in.
      That said, if you are looking at doing a full blown text adventure, Godot is actually a somewhat poor fit. It would work but again, not a great fit. There are dedicated text only engines out there that give you things like natural language parsing and more.

    • @baileyburnsed4352
      @baileyburnsed4352 6 лет назад

      I made one just with C# Code, I just like GDscript better then Python and C# or Lua, But thank you for the info. my be unity

    • @gamefromscratch
      @gamefromscratch  6 лет назад

      I think you will find Unity as much or worse of a fit. If you don't need graphics, most modern game engines are a pretty poor fit for text adventures.

    • @nympseudonym
      @nympseudonym 6 лет назад

      If you're making a dedicated text adventure I would suggest ADRIFT or RAGS which are engines made specifically for text adventures.

    • @baileyburnsed4352
      @baileyburnsed4352 6 лет назад

      I am making a moble text adventure
      I need Buttons

  • @baileyburnsed4352
    @baileyburnsed4352 6 лет назад

    I am interested in mobile text adventures based on buttons and messages

  • @somniad
    @somniad 4 года назад

    lol thinking about making a script that skips forward 15 seconds when it hears the word "book"

  • @jafsterlordbib
    @jafsterlordbib 5 лет назад

    aaw godot has a godot after a condition :)

  • @itayminster5144
    @itayminster5144 6 лет назад

    17:00

  • @metalim
    @metalim 5 лет назад

    "if event.echo == true:" - doh... not another one.

  • @AndreasIndustriePro
    @AndreasIndustriePro 5 лет назад +1

    wtf you delete the sign of xAxis only then to differentiate between positive and negative xAxis? ... wtf?
    just go:
    if abs(xAxis) > DeadZone:
    position += delta * Multiplier * xAxis
    in case of negative xAxis it automatically turns into
    position -= delta * Multiplier * abs(xAxis)