Check Mouse Input in GODOT 4!! (Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys welcome back to a brand new video on the channel today I'm just going to be showing you how to check the mouse inut without further Ado let's start okay so I'm just going to show you guys what I have set up here I have a button here set up uh and then to this button we are going to uh do for button mask we want to check if if the mouse left is clicked and the mouse right and then lastly we want to check action mode if it's pressed so here it's going to consider it pressed when it's actually pressed yeah it's pretty simple then here we if we go into our script we have variable called coins and then here we want to print coins so when we click the button if uh here what we want to do if it's left you want to only make it go up by one but if it's clicked in right we're going to make it go up by five so how we can do that go to node then collect uh sorry connect the variable pressed uh sorry signal press that I say variable and then here what we're going to do is uh if input dot isore mouse button pressed and you're left what's going to happen is you're going to make Coins Plus equal one and just copy this and do this a second time but with the right so here if we can just do right plus equal five here you you guys are going to see that it's printing all the time so if you just do play here you can see here that it's printing the whole time is0 zero if I press it by one goes up by one again and again if I press the left but if I press the right it went up by five so yeah that's just very simple h on how you can do this it's really simple if you if you guys want to do it this is all that it takes is mouse button pressed and then you just got to say which one then yeah if you guys enjoyed this video the like but hit subscribe button I'll see you guys in the
Info
Channel: Vetro Dev
Views: 136
Rating: undefined out of 5
Keywords:
Id: T8IoYsWb060
Channel Id: undefined
Length: 2min 2sec (122 seconds)
Published: Sun Apr 28 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.