First get the direction from enemy to the player. You do that with player.global_position - enemy.global_position. You get a direction vector pointing from the enemy towards the player. Then normalize the vector by calling normalize() function on it. Normalizing a vector means you make it a unit vector, so its only a direction but no magnitude. Then you multiply this vector by the enemy speed and you add this to enemy position.
My personal favourite that I learned a lot by watching it is "The ultimate introduction to Godot 4" by Clear Code on youtube. But its for 2D so if you are looking for a 3D tutorial you will have to look for something else.
There is no "is playing" property inside the AnimationSprite2D. I assume you want to start playing the animation? You have to do $AnimationSprite2D.play("animation_name").
No, not really. Sure out in the wild it was running good but in towns the fps dropped quite a lot. fps drop was so big in Saint Denis that I tried to avoid going there as much as possible. Really ruined the experience.
Use 4.2 where it was reimplemented.
First get the direction from enemy to the player. You do that with player.global_position - enemy.global_position. You get a direction vector pointing from the enemy towards the player. Then normalize the vector by calling normalize() function on it. Normalizing a vector means you make it a unit vector, so its only a direction but no magnitude. Then you multiply this vector by the enemy speed and you add this to enemy position.
Actually CharacterBody2D is what i use the most for my player/enemies
Nope, its in physics process.
Yeah 3.5.x but not 4.x
https://docs.godotengine.org/en/stable/tutorials/physics/physics_introduction.html
Ohh thank you I completely missed that. It works now!
You can enable in editor settings if a variable doesnt have a declared type, the editor will give you a warning or a straight up error.
Top right press on the tile set resource there you will be able to change default tile size
That was how it was done in Godot 3. Godot 4 is different. I suggest you find a different tutorial.
This tutorial by Clear Code is good. Its for Godot 4 and is 11+ hours long. https://www.youtube.com/watch?v=nAh_Kx5Zh5Q&t
The largest game dev tutorial yt channel with 1.6 million subs. He did tutorials for Unity. But he quit his yt channel like 3 years ago.
Thank you man that works! But I dont understand why we need to set the node name to be the same as the peer id. Do you know why?
If you have 0 experience with game dev then yeah i would say so.
PhysicsBody2D is just an abstract base class inherited by CharacterBody2D and RigidBody2D.
CharacterBody2D is generally used if you want to make player controller or enemies moved by code etc.
RigidBody2D is used if you want to move an object by actual physics. So you have to apply forces to it - its moved by the physics engine.
https://docs.godotengine.org/en/stable/tutorials/physics/using_character_body_2d.html
Clear code has a good 4.x tutorial. Its 11 hours long.
Any update on this?
The official Godot discord server already has a channel dedicated for unity users asking questions.
My personal favourite that I learned a lot by watching it is "The ultimate introduction to Godot 4" by Clear Code on youtube. But its for 2D so if you are looking for a 3D tutorial you will have to look for something else.
There is no "is playing" property inside the AnimationSprite2D. I assume you want to start playing the animation? You have to do $AnimationSprite2D.play("animation_name").
GDQuest is pretty good i would say.
No, not really. Sure out in the wild it was running good but in towns the fps dropped quite a lot. fps drop was so big in Saint Denis that I tried to avoid going there as much as possible. Really ruined the experience.
End of this list.
Back to top