Excellent tut, well done! 👏 Newb question... if I wanted to trigger one of 8 movement animations (up / up-left / left / down-left / down / down-right / right / up-right), would I just use a series of conditionals on the x / y vector values to fire the appropriate walking animation?
in my run state in my state machine, how can i use this movement method for a Input.is_action_pressed(etc all the directions and have it 8 way movement
Is there a way I can make the movement less slidey? I would like more precise movement when the key is released. Amazing tutorial, really helped me out.
Why would we use a sprite node over an animated sprite node? I’m very new to Godot and curious how choosing or the other might impact making the player.
I understand that adding in an animated sprite would allow for adding animation, my question is why would that not be used here? In other tutorials I have seen the same Sprite2D node used over the AnimatedSprite2D, I am curious if that is because it has other wider implications for coding or programming other than being able to add animation frames.
(new to godot) im pretty sure if you want to remove the accel / sliding affect you can do it like velocity = playerInput * speed * delta but you have to put SPEED to a mil or smthn high, i think
Hey Kobe. I followed your guide and created the same player movement you're showing here. WASD works great. But when I incorporate MarcoFazio's Virtual Joystick add-on from the AssetLibrary (following WisconsiKnight's tutorial, a fellow Godot UA-camr), the movement feels a little wonky, especially when attempting to drive in any direction that's not the 0, 45, 90, 135, 180, 225, 270, 315 or 360 degree of the joystick, if that makes sense. Could you help us incorporate the joystick into Godot? Or perhaps make our own? :')
I’m not too sure how the plugin works but I would try to get whatever the vector is of the joystick direction is and then I would apply a force is in that direction (you can do this by normalising the vector)
Thank you so much for the tutorial, but I have one question. What if I want the camera of the player to collide with the edges of the scene? I mean, if player reaches the corner of the map, how do I make the camera stop and not go through the borders?
At around 2:31 I am getting the error message ''Cannot find property ''get_action_strength'' on base ''vector2'' and I dont understand what that even means.
You need brackets because get_action_strength() is a method not a property. The error is basically saying you are trying to access a property of a vector2 (a property is like a variable at the top such as ‘x’ or ‘y’) but a method is something you need to call so we need the brackets to make sure we’re calling a method and not accessing a property
I would probably set a vector or a scalar value you want the character to move with and instead of using Input.get_action_direction, get_action_strength or is_action_pressed, use Input.is_action_just_pressed for your up, down, left and right movements, and move that specified length for each input, this way it will only be called each time you press the key, not being called for as long as the key is held down
the code isn't efficient you could use Input.get_vector instead and move_and_slide underneath it use a velocity var which is gonna be velocity = direction * speed and the Input.get_vector is gonna be the in the direction variable
My apologies for any unintentional disturbance to the NNN sanctity. I understand this month requires a next-level commitment, and I respect your dedication to the cause. Let's turn this into a positive challenge-you've got this! Surround yourself with distractions, find new hobbies, or maybe binge-watch some non-triggering content. Remember, it's not just a challenge; it's a testament to your willpower. Stay strong and conquer NNN! 💪🚀
Small tubers like this are the real gems and mvp.
Tyyyyyyyy
Yes absolutely
"sbrueceibe!" 🤣you got me rollin', gonna sub for sure!
Excellent tut, well done! 👏 Newb question... if I wanted to trigger one of 8 movement animations (up / up-left / left / down-left / down / down-right / right / up-right), would I just use a series of conditionals on the x / y vector values to fire the appropriate walking animation?
Great tutoriel thanks
I think in Godot 4. Doesn't it make more sense to just use get_vector?
var direction = Input.get_vector("left","right","up","down")
Oh damn I didn’t even realise they had that method In godot 4 I definitely need to read the docs 😂
in my run state in my state machine, how can i use this movement method for a Input.is_action_pressed(etc all the directions and have it 8 way movement
Is there a way I can make the movement less slidey? I would like more precise movement when the key is released. Amazing tutorial, really helped me out.
Increasing the acceleration should do the trick
probably change your acceleration to 1
Why would we use a sprite node over an animated sprite node? I’m very new to Godot and curious how choosing or the other might impact making the player.
I got the same question maybe because animated sprite is more customizable?
@@Whhatt I think choosing an animated sprite would mean you can add frames and animation to the character
I understand that adding in an animated sprite would allow for adding animation, my question is why would that not be used here? In other tutorials I have seen the same Sprite2D node used over the AnimatedSprite2D, I am curious if that is because it has other wider implications for coding or programming other than being able to add animation frames.
@ariB65 using animated sprite 2d is better most of the time if you plan on animating later
(new to godot)
im pretty sure if you want to remove the accel / sliding affect you can do it like
velocity = playerInput * speed * delta
but you have to put SPEED to a mil or smthn high, i think
how should i change the code if i would like my character to start walking instantly but keep the sliding effect when theres no input atm?
How do i add like animation to it like left, right, up, down animation
Hey Kobe. I followed your guide and created the same player movement you're showing here. WASD works great. But when I incorporate MarcoFazio's Virtual Joystick add-on from the AssetLibrary (following WisconsiKnight's tutorial, a fellow Godot UA-camr), the movement feels a little wonky, especially when attempting to drive in any direction that's not the 0, 45, 90, 135, 180, 225, 270, 315 or 360 degree of the joystick, if that makes sense. Could you help us incorporate the joystick into Godot? Or perhaps make our own? :')
I’m not too sure how the plugin works but I would try to get whatever the vector is of the joystick direction is and then I would apply a force is in that direction (you can do this by normalising the vector)
Thank you so much for the tutorial, but I have one question. What if I want the camera of the player to collide with the edges of the scene? I mean, if player reaches the corner of the map, how do I make the camera stop and not go through the borders?
I think there is a setting in the camera called something like damping or maybe clipping
How did you move the character to the tile map scene?
At around 2:31 I am getting the error message ''Cannot find property ''get_action_strength'' on base ''vector2'' and I dont understand what that even means.
You need brackets because get_action_strength() is a method not a property. The error is basically saying you are trying to access a property of a vector2 (a property is like a variable at the top such as ‘x’ or ‘y’) but a method is something you need to call so we need the brackets to make sure we’re calling a method and not accessing a property
How would you handle tile-moving characters? If i press my walk key once i want it to move one tile, for example.
I would probably set a vector or a scalar value you want the character to move with and instead of using Input.get_action_direction, get_action_strength or is_action_pressed, use Input.is_action_just_pressed for your up, down, left and right movements, and move that specified length for each input, this way it will only be called each time you press the key, not being called for as long as the key is held down
cannot find property "get_action_strenght" on base vector 2. what must i do ?
Capitalise input
You spelt strength wrong in your comment, maybe that’s why
but how can i add movement animation to this
const MIN_SPEED = 20
If velocity.length() > MIN_SPEED:
$AnimationPlayer.play(“run”)
else:
$AnimationPlayer.play(“idle”)
@@kobedevhow would you put a run up or run down animation
@@DyIanGaming If velocity.y > MIN_SPEED:
$AnimationPlayer.play(“run_down”)
elif velocity.y < -MIN_SPEED:
$AnimationPlayer.play(“run_up”)
elif velocity.x > MIN_SPEED:
$AnimationPlayer.play(“run_right”)
elif velocity.x < -MIN_SPEED:
$AnimationPlayer.play(“run_left”)
else:
$AnimationPlayer.play(“idle”)
@@kobedev thank you so much I looked through 5 different tutorials to try to get this working
@@DyIanGaming no worries bro i totally get that feeling when you finally fix that one thing that's bugging you so I'm glad to have helped!
the code isn't efficient you could use Input.get_vector instead and move_and_slide underneath it use a velocity var which is gonna be velocity = direction * speed and the Input.get_vector is gonna be the in the direction variable
How do you disable the gravity?
It’s in the editor settings, select floating under motion mode
You might be using the wrong node type
where can i find this but in C# , I have godot but im used to coding in c#
I’m actually not familiar with any c# channels sorry, I also don’t know c#
no you're not "used to coding in c#". you're used to "copying code" in c#. because it's really simple to implement this
Sbriceibed to the channel
Let’s go bro! Glad you enjoyed
Ha, now you can make money
Shouldn't have posted this during NNN🔥
My apologies for any unintentional disturbance to the NNN sanctity. I understand this month requires a next-level commitment, and I respect your dedication to the cause. Let's turn this into a positive challenge-you've got this! Surround yourself with distractions, find new hobbies, or maybe binge-watch some non-triggering content. Remember, it's not just a challenge; it's a testament to your willpower. Stay strong and conquer NNN! 💪🚀
Great response.