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
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
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.
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
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.
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.
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 ;)
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
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.
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)
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
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"
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!?
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.
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.
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
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
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)
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.
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.
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.
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.
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.
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
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
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.
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)
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
thanks.
You are single-handedly teaching me Godot good sir. You're the best Godot tutor on RUclips. Super underrated. Thank you.
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
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.
26:44 For some reason that "JOY AXIS" variable makes me chuckle.
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
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.
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.
Man so many great creators making great godot tutorials! keep it up :)
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 ;)
ooo...the input map is sweet...thank you.
Great tips, thank you for this very essential tutorial!
Great Tutorial - looking forward to the book also
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!
Love your tutorials, just what I was looking for!!!!
This was extremely helpful. Thank you so much
To bring up the documentation search bar at 34:07, Ctrl+F.
Same as any web page using Windows.
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
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.
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)
Thank you for this very useful tutorial!
Is not using += xAxis same as using -= abs(xAxis) and += abs(xAxis) with 2 separate if conditions? That part seemed redundant. Otherwise great video 😊
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
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"
noob here...so, how should it look like?
Excellent series. Thank you!
so we should use _input(event) or _process(delta) to move ur player? or this no matter for cpu?
heeyy thanks!! this course is super!!! thanks for dedicated ur time in show how make games in Godot (100% open Source!!) :)
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!?
I've been wanting this, too. But even in Godot 4 it seems not to be possible.
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.
can i have a tutorial of the same nature for 3d objects,links are welcome
thank you
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.
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
Oh my god this is so much faster than Python. I'm so glad I decided to switch.
Thank you man!!!
You're my hero!
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
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.
you need to do Input.is_joy_known
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)
If it detects in the windows joystick control panel it should work just fine either way.
Is there a way to tell the code to register an input, such as a key on the keyboard, as a mouse click?
“Python and Godot are the only languages that have a Godot after a...” XD 12:06
12:06 *
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.
When printing, you can do [deviceid+1] to make it look like the first joy-con when the game still sees it as 0
thanks ,very impressive.
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.
why are you making the script in the sprite and not in the player?
and why not use the move and slide funtion?
When I click the icon wants to move to the bottom right area or my mouse curser will move instead.
Are You going to cover multiple Viewports or Anchors/Layouts in your GUI video?
It is not working with my SwitchProController. How can I fix this?
Did you ever find a solution to this?
@@jimmyg8100 nope, but apparently Godot thinks that all buttons are being held constantly
@@FelixxFelixx-tt7sf But you got Godot to read your controller?
@@jimmyg8100 ya
How did you get it to read your Switch Pro Controller?
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.
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.
What if i want to use the stick on the Y
Can you please make a tutorial series on Escoria Framework (Point and Click) - Godot 3.0?
And btw, thank you for your awesome tutorials.
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.
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.
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
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
Yeah, I will be covering mobile inputs in a later chapter.
I am scared that there are no semicolons and brackets.
can you use strings as input
for text adventures
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.
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
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.
If you're making a dedicated text adventure I would suggest ADRIFT or RAGS which are engines made specifically for text adventures.
I am making a moble text adventure
I need Buttons
I am interested in mobile text adventures based on buttons and messages
lol thinking about making a script that skips forward 15 seconds when it hears the word "book"
aaw godot has a godot after a condition :)
17:00
"if event.echo == true:" - doh... not another one.
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)