PokeVideoPlayer v23.9-app.js-020924_
0143ab93_videojs8_1563605 licensed under gpl3-or-later
Views : 9,251
Genre: Entertainment
Uploaded At Oct 2, 2023 ^^
warning: returnyoutubedislikes may not be accurate, this is just an estiment ehe :3
Rating : 4.953 (9/763 LTDR)
98.83% of the users lieked the video!!
1.17% of the users dislieked the video!!
User score: 98.25- Masterpiece Video
RYD date created : 2024-11-17T16:15:58.791787Z
See in json
Top Comments of this video!! :3
For anyone wondering how you would actually do this if you are reading this way later, Godot 4.x has built in functions that deal with this type of thing and you'll use a Navigation2D node and the move_and_slide() function. Using these two in conjunction means you really don't have to program your own AI.
func MoveToTarget(delta: float) -> void:
$NavigationAgent2D.target_position = Target.global_position
var direction = $NavigationAgent2D.get_next_path_position() - global_position
direction = direction.normalized()
velocity = velocity.lerp(direction * Speed, Acceleration * delta)
if velocity.x != 0:
$AnimatedSprite2D.flip_h = velocity.x < 0
$AnimatedSprite2D.play("move")
move_and_slide()
Itll end up looking something like this.
1 |
@purplefood1
1 year ago
GJ you officially made better AI than call fo duty zombies
54 |