Very nice! But i would add a little step to detect and exclude very short swipes, just adding a variable called min_distance and checking the distance of the swipe to determine if is bigger than the threshold.
@@elektroskeptic481 You will have to work with the animation player there. I'm necroing this just to post an answer here case anyone else has this doubt. A tut on this can be: ua-cam.com/video/x8wgVNN9FsI/v-deo.html. That's just an example, you can use it for fade effects on scene transitions, etc, etc.
I think it might be important to use the "emulate touch from mouse", and also I changed the code so that if the x and y directions are the same, it's not gonna just say i swiped vertically, but rather emit a signal for a click
@@Silve4 Sure, but first try to work it out with what I've said. If the x direction has the same value as the y direction, emit a custom signal. If you're not sure what most of that means, you should learn about if statements and custom signals. If you still need help I'll post my code. try to push yourself 😊
how would be the "export" code line equivalent to Godot 4? the syntax has changed and I can't get it. Tryed the @export but i get an error "Annotation @export requires at most 0 arguments, but 3 were given.". The code: @export (float, 1.0, 1.5) var MAX_DIAGONAL_SLOPE = 1.3
Hello I realize I’m not sure I understand the math behind the slope and the angle (especially the math vocabulary since english is not my native langage). So I was wondering if anyone could link some ressource about it. Would be really appreciated. To add a little bit of context, I tried to readapt the code to be able to handle vertical swipe aswell as horizontal swipe but it wont detect swipe going up but the others directions work. I only changed the maximum slope to 1.5 and the timer to 1 second, nothing else.
Can you please make a video about how to make UI elements follow the player within the camera? When my player moves, the UI elements don't follow him. I wanted to know if there is a smart way to do this with Nodes. Rather than updating the position of the UI in the process function.
bro i am messing too much... in your channel there was a playlist that how can we make our first platform 2d game in godot but the problem is how can i do gestures in that game pls help me.....
To know where teh Player touched, you just use "event.position" in your _input function. If you want to know the part how to translate the touch position to a position in your game world, here you go: pastebin.com/uVgmzKFU
Thank you very much for getting me started with the Gesture Controls implementation for my game. But when things became clear, I completely branched off from the tutorial (stopped watching it) because copying the tutorial as-is for my much more specialized use-case (where the gesture detection doesn't need to be nearly as precise) would've been Very Stupid because there would've been a lot of stuff in my code that I don't actually need.
Either with code: - In the Script of the SwipeDetector paste this: *func _ready():* *$Timer.connect("timeout", self, "_on_Timer_timeout")* Or Graphically: - Select the Timer - Click on the "Node" tab next to "Inspector" - Click on "timeout()" - Click on "Connect" - Click on "Connect" again
I would like a tutorial on how to detect continuous long touch, for like a hypercasual game. Also if anyone knows where I can get free hypercasual game templates, I will be most grateful.
You explain in rigid stiff fierce softness. I didn't like it. LOVE IT
6 років тому+4
I found that the mic automatically muting (voice activated) is a bit irritating. I would rather hear some background noise than total silence when you're not saying anything. About the content, it looks very useful! Thanks!
Awesome!
Just one tip if you're stuck, you need to tick "emulate mouse from touch" in the settings in order for this to work
Very nice! But i would add a little step to detect and exclude very short swipes, just adding a variable called min_distance and checking the distance of the swipe to determine if is bigger than the threshold.
Good Idea!
Guys, is there a way to have smooth transition between slides, not this instant one?
@@RTSFan1337 Do you know how to make slides shift smoothly, not instantly?
@@elektroskeptic481 You will have to work with the animation player there. I'm necroing this just to post an answer here case anyone else has this doubt. A tut on this can be: ua-cam.com/video/x8wgVNN9FsI/v-deo.html. That's just an example, you can use it for fade effects on scene transitions, etc, etc.
I think it might be important to use the "emulate touch from mouse", and also I changed the code so that if the x and y directions are the same, it's not gonna just say i swiped vertically, but rather emit a signal for a click
Can you show me that code? I am trying to implement taping in my game and am having a bit of trouble
@@Silve4 Sure, but first try to work it out with what I've said. If the x direction has the same value as the y direction, emit a custom signal.
If you're not sure what most of that means, you should learn about if statements and custom signals. If you still need help I'll post my code. try to push yourself 😊
I love your voice. It makes enjoying the tutorials 10x more.
Thanks for the kind comment 🙂
I think he has a Brazilian accent, because I'm from Brazil too
how would be the "export" code line equivalent to Godot 4? the syntax has changed and I can't get it. Tryed the @export but i get an error "Annotation @export requires at most 0 arguments, but 3 were given.". The code: @export (float, 1.0, 1.5) var MAX_DIAGONAL_SLOPE = 1.3
Brilliant! Just what I needed and it wasn't going to be easy to figure out.
Guilherme??? different pace, this is much better (for me) than when you are rushing, thank you nice tutorial!!!
THANK YOU SO MUCH! THIS WAS SO HELPFUL!
And if I want to draw a Line2D using the start and end of the swipe?
Can something like this be done to control the panning of the camera when the user is dragging or is there a better way to do it?
There is, I do it like that:
pastebin.com/tw00TYEi
"This is a bit of text
And here's some more
Coloring is going to be a pain in the butt"
So understandable :P
Hello I realize I’m not sure I understand the math behind the slope and the angle (especially the math vocabulary since english is not my native langage). So I was wondering if anyone could link some ressource about it. Would be really appreciated.
To add a little bit of context, I tried to readapt the code to be able to handle vertical swipe aswell as horizontal swipe but it wont detect swipe going up but the others directions work. I only changed the maximum slope to 1.5 and the timer to 1 second, nothing else.
Thanks a lot!
Can you please make a video about how to make UI elements follow the player within the camera? When my player moves, the UI elements don't follow him. I wanted to know if there is a smart way to do this with Nodes. Rather than updating the position of the UI in the process function.
canvas layer
you are making things worse.
Guilherme vc é br, vc não me engana 🤣🤣
WOOW! thanks a lot
it's what you need. I wand adaptive this for swipe of mouse, for multi platform game.
bro i am messing too much... in your channel there was a playlist that how can we make our first platform 2d game in godot but the problem is how can i do gestures in that game pls help me.....
Thanks and n8ce tutorial.
Pls make how to know touch position in screen to shot to that position.
To know where teh Player touched, you just use "event.position" in your _input function. If you want to know the part how to translate the touch position to a position in your game world, here you go:
pastebin.com/uVgmzKFU
If its a 3D game you can shoot a raycast from under your cursor
And then, how can i detect the swipe , i tried to test with a print but i cant, pls anyone can help me??
Connect the signal
Nice, now add it as a feature in godot
please make an updated tutorial
Which script is used : gdscript or c#
Pretty sure it's gdscript. Not sure if you still need this answer.
hy eveyone, if i have a button pause, how i know it just press button, i don't wana Swipes now
Thank you very much for getting me started with the Gesture Controls implementation for my game.
But when things became clear, I completely branched off from the tutorial (stopped watching it)
because copying the tutorial as-is for my much more specialized use-case
(where the gesture detection doesn't need to be nearly as precise)
would've been Very Stupid because there would've been a lot of stuff in my code that I don't actually need.
Can u please make a tutorial about tilt control in android
BR maninho? Nice tutorial!
I can't get the input event to trigger at all. no matter how muhc I touch nothin happens
How to connect it
Either with code:
- In the Script of the SwipeDetector paste this:
*func _ready():*
*$Timer.connect("timeout", self, "_on_Timer_timeout")*
Or Graphically:
- Select the Timer
- Click on the "Node" tab next to "Inspector"
- Click on "timeout()"
- Click on "Connect"
- Click on "Connect" again
@@bittim Still not working.
Thanks bro
You're welcome!
I cant make this project work under godot 3.5.2
I would like a tutorial on how to detect continuous long touch, for like a hypercasual game. Also if anyone knows where I can get free hypercasual game templates, I will be most grateful.
You just don't need the timer I think
enable on your pc emualte touch from mouse
even after doing this it won't work
You explain in rigid stiff fierce softness. I didn't like it. LOVE IT
I found that the mic automatically muting (voice activated) is a bit irritating. I would rather hear some background noise than total silence when you're not saying anything.
About the content, it looks very useful! Thanks!
What a version of Godot it is?
No entendí nada
so how to use it? this is not a noob friendly tutorial hmm :((
I need it to :((((