Skip to content

u/zigaliro

In this archive from Jun 2020 to Nov 2024

18
posts
22
comments
21
media
107
score
1 saved before deletion

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.

1 points

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.

1 points

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.

3 points

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.

1 points

End of this list.

Back to top

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

โ†orโ†’
Previous / next file
โ†‘orโ†“
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.